From aacd4aac7bbc2bdfdc29e89b4fd88fbcc90cf4b9 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 3 Jun 2026 17:19:22 +0000 Subject: [PATCH 1/9] Backflow from https://github.com/dotnet/dotnet / 6f5c5dc build 317065 Diff: https://github.com/dotnet/dotnet/compare/8dd517f9583a4cc48e2389ce00f5f0fcd6cfda3e..6f5c5dc027109e572313690b0fc81dacbb2baba5 From: https://github.com/dotnet/dotnet/commit/8dd517f9583a4cc48e2389ce00f5f0fcd6cfda3e To: https://github.com/dotnet/dotnet/commit/6f5c5dc027109e572313690b0fc81dacbb2baba5 [[ commit created by automation ]] --- eng/Versions.props | 2 +- eng/native/version/_version.c | 2 +- eng/native/version/copy_version_files.ps1 | 2 +- eng/native/version/copy_version_files.sh | 2 +- eng/pipelines/runtime-official.yml | 19 ------------------- .../JitInterface/CorInfoImpl.RyuJit.cs | 4 +++- .../Directory.Build.props | 1 + src/installer/pkg/sfx/installers.proj | 1 + .../dotnet-runtime-deps-azl.4.proj | 11 +++++++++++ src/mono/CMakeLists.txt | 2 +- 10 files changed, 21 insertions(+), 25 deletions(-) create mode 100644 src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-azl.4.proj diff --git a/eng/Versions.props b/eng/Versions.props index 7a0ce8154d3ffd..a74833c8791bf9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -15,7 +15,7 @@ 7.0.20 6.0.36 preview - 5 + 6 false release diff --git a/eng/native/version/_version.c b/eng/native/version/_version.c index 153d9f05f14e4c..f613aedb3195cc 100644 --- a/eng/native/version/_version.c +++ b/eng/native/version/_version.c @@ -1,4 +1,4 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -static char sccsid[] __attribute__((used)) = "@(#)No version information produced"; +static char sccsid[] __attribute__((used,retain)) = "@(#)No version information produced"; diff --git a/eng/native/version/copy_version_files.ps1 b/eng/native/version/copy_version_files.ps1 index 35a6e1dcc14d4a..232bd0274485f0 100644 --- a/eng/native/version/copy_version_files.ps1 +++ b/eng/native/version/copy_version_files.ps1 @@ -7,7 +7,7 @@ Get-ChildItem -Path "$VersionFolder" -Filter "_version.*" | ForEach-Object { # For _version.c, update the commit ID if it has changed from the last build. $commit = (git rev-parse HEAD 2>$null) if (-not $commit) { $commit = "N/A" } - $substitute = "static char sccsid[] __attribute__((used)) = `"@(#)Version N/A @Commit: $commit`";" + $substitute = "static char sccsid[] __attribute__((used,retain)) = `"@(#)Version N/A @Commit: $commit`";" $version_file_contents = Get-Content -Path $path | ForEach-Object { $_ -replace "^static.*", $substitute } $version_file_destination = "$RepoRoot\\artifacts\\obj\\_version.c" $current_contents = "" diff --git a/eng/native/version/copy_version_files.sh b/eng/native/version/copy_version_files.sh index d60ed4715b5ec3..a1625cfe17e6b9 100755 --- a/eng/native/version/copy_version_files.sh +++ b/eng/native/version/copy_version_files.sh @@ -11,7 +11,7 @@ for path in "${__VersionFolder}/"*{.h,.c}; do # update commit commit="$(git rev-parse HEAD 2>/dev/null)" commit="${commit:-N/A}" - substitute="$(printf 'static char sccsid[] __attribute__((used)) = "@(#)Version N/A @Commit: %s";\n' "$commit")" + substitute="$(printf 'static char sccsid[] __attribute__((used,retain)) = "@(#)Version N/A @Commit: %s";\n' "$commit")" version_file_contents="$(cat "$path" | sed "s|^static.*|$substitute|")" version_file_destination="$__RepoRoot/artifacts/obj/_version.c" current_contents= diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index a5af228a5bab4c..457a1b0d28e457 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -17,13 +17,6 @@ trigger: - PATENTS.TXT - THIRD-PARTY-NOTICES.TXT -schedules: -- cron: "0 9 * * *" - displayName: Daily SourceIndex - branches: - include: - - main - # This is an official pipeline that should not be triggerable from a PR, # there is no public pipeline associated with it. pr: none @@ -55,18 +48,6 @@ extends: LclSource: lclFilesfromPackage LclPackageId: 'LCL-JUNO-PROD-RUNTIME' - - ${{ if or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Build.Reason'], 'Manual')) }}: - - stage: Source_Index - dependsOn: [] - displayName: Source Index - jobs: - # - # Source Index Build - # - - template: /eng/common/templates-official/job/source-index-stage1.yml - parameters: - sourceIndexBuildCommand: build.cmd -subset libs.sfx+libs.oob -binarylog -os linux -ci /p:SkipLibrariesNativeRuntimePackages=true - - stage: Publish dependsOn: [] jobs: diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs index 6c22da04d78a90..3c2d8e8008c116 100644 --- a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs +++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs @@ -770,7 +770,9 @@ private ISymbolNode GetHelperFtnUncached(CorInfoHelpFunc ftnNum) id = ReadyToRunHelper.GVMLookupForSlot; break; case CorInfoHelpFunc.CORINFO_HELP_INTERFACEDISPATCH_FOR_SLOT: - if ((_compilation._compilationOptions & RyuJitCompilationOptions.ControlFlowGuardAnnotations) != 0) + if ((_compilation._compilationOptions & RyuJitCompilationOptions.ControlFlowGuardAnnotations) != 0 + // Not implemented on x86: https://github.com/dotnet/runtime/issues/99516 + && _compilation.NodeFactory.TypeSystemContext.Target.Architecture != TargetArchitecture.X86) return _compilation.NodeFactory.ExternFunctionSymbol(new Utf8String("RhpInterfaceDispatchGuarded"u8)); return _compilation.NodeFactory.ExternFunctionSymbol(new Utf8String("RhpInterfaceDispatch"u8)); case CorInfoHelpFunc.CORINFO_HELP_INTERFACELOOKUP_FOR_SLOT: diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props index e7f043d64f5213..84c6b6702a5458 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props @@ -75,6 +75,7 @@ + diff --git a/src/installer/pkg/sfx/installers.proj b/src/installer/pkg/sfx/installers.proj index c172f12ea8fcaa..7a03d9088cd116 100644 --- a/src/installer/pkg/sfx/installers.proj +++ b/src/installer/pkg/sfx/installers.proj @@ -10,6 +10,7 @@ + diff --git a/src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-azl.4.proj b/src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-azl.4.proj new file mode 100644 index 00000000000000..8a8beec76e7646 --- /dev/null +++ b/src/installer/pkg/sfx/installers/dotnet-runtime-deps/dotnet-runtime-deps-azl.4.proj @@ -0,0 +1,11 @@ + + + false + true + azl.4 + + + + + + diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index c1a8d29f657a62..4ef4acb0eee17d 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -857,7 +857,7 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") endif() else() if(NOT EXISTS "${VERSION_FILE_PATH}") - file(WRITE "${VERSION_FILE_PATH}" "static char sccsid[] __attribute__((used)) = \"@(#)Version 42.42.42.42424 @Commit: AAA\";\n") + file(WRITE "${VERSION_FILE_PATH}" "static char sccsid[] __attribute__((used,retain)) = \"@(#)Version 42.42.42.42424 @Commit: AAA\";\n") endif() endif() if (NOT EXISTS "${RUNTIME_VERSION_HEADER_PATH}") From a333e2bc5a0d44eb26a0ae951d0ff67be91445e0 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Wed, 3 Jun 2026 17:19:30 +0000 Subject: [PATCH 2/9] Update dependencies from build 317065 Updated Dependencies: Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.BannedApiAnalyzers, Microsoft.CodeAnalysis.CSharp, Microsoft.Net.Compilers.Toolset (Version 5.8.0-1.26266.103 -> 5.9.0-1.26302.118) Microsoft.CodeAnalysis.NetAnalyzers, Microsoft.DotNet.ApiCompat.Task, Microsoft.NET.Workload.Emscripten.Current.Manifest-11.0.100.Transport (Version 11.0.100-preview.5.26257.113 -> 11.0.100-preview.6.26302.118) 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.XliffTasks, Microsoft.DotNet.XUnitExtensions (Version 11.0.0-beta.26257.113 -> 11.0.0-beta.26302.118) Microsoft.DotNet.Cecil (Version 0.11.5-preview.26257.113 -> 0.11.5-preview.26302.118) Microsoft.DotNet.XUnitConsoleRunner (Version 2.9.3-beta.26257.113 -> 2.9.3-beta.26302.118) Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, runtime.native.System.IO.Ports, System.Reflection.Metadata, System.Reflection.MetadataLoadContext, System.Text.Json (Version 11.0.0-preview.5.26257.113 -> 11.0.0-preview.6.26302.118) NuGet.Frameworks, NuGet.Packaging, NuGet.ProjectModel, NuGet.Versioning (Version 7.7.0-rc.25813 -> 7.9.0-rc.30318) System.CommandLine (Version 3.0.0-preview.5.26257.113 -> 3.0.0-preview.6.26302.118) runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.osx-arm64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.osx-x64.Microsoft.NETCore.Runtime.JIT.Tools, runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang, runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk, runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools, runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang, runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk, runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools, runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang, runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk, runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools, runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang, runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk, runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools, runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang, runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk, runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools, runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang, runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk, runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools, runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Libclang, runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk, runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools (Version 19.1.0-alpha.1.26208.2 -> 19.1.0-alpha.1.26256.1) runtime.linux-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport, runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport, runtime.linux-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport, runtime.linux-musl-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport, runtime.osx-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport, runtime.osx-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport, runtime.win-arm64.Microsoft.NETCore.Runtime.Wasm.Node.Transport, runtime.win-x64.Microsoft.NETCore.Runtime.Wasm.Node.Transport (Version 11.0.0-alpha.1.26208.5 -> 11.0.0-alpha.1.26279.1) [[ commit created by automation ]] --- eng/Version.Details.props | 152 ++++----- eng/Version.Details.xml | 306 +++++++++--------- eng/common/AGENTS.md | 5 + eng/common/build.ps1 | 20 +- eng/common/build.sh | 24 +- .../core-templates/job/helix-job-monitor.yml | 217 +++++++++++++ eng/common/core-templates/job/onelocbuild.yml | 3 + .../core-templates/steps/publish-logs.yml | 4 - .../steps/source-index-stage1-publish.yml | 8 +- eng/common/cross/build-rootfs.sh | 111 +++---- eng/common/cross/install-debs.py | 147 ++++++--- eng/common/cross/toolchain.cmake | 12 +- eng/common/dotnet-install.ps1 | 6 +- eng/common/dotnet-install.sh | 6 +- eng/common/native/install-dependencies.sh | 8 +- eng/common/pipeline-logging-functions.ps1 | 2 +- eng/common/templates/steps/vmr-sync.yml | 20 +- eng/common/tools.ps1 | 166 +++------- eng/common/tools.sh | 77 +---- global.json | 8 +- 20 files changed, 753 insertions(+), 549 deletions(-) create mode 100644 eng/common/AGENTS.md create mode 100644 eng/common/core-templates/job/helix-job-monitor.yml diff --git a/eng/Version.Details.props b/eng/Version.Details.props index e2925d4d9c12ba..b9df95c88f99d2 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,89 +6,89 @@ This file should be imported by eng/Versions.props - 5.8.0-1.26266.103 - 5.8.0-1.26266.103 - 5.8.0-1.26266.103 - 5.8.0-1.26266.103 - 11.0.100-preview.5.26257.113 - 11.0.100-preview.5.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 0.11.5-preview.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 - 11.0.0-beta.26257.113 + 5.9.0-1.26302.118 + 5.9.0-1.26302.118 + 5.9.0-1.26302.118 + 5.9.0-1.26302.118 + 11.0.100-preview.6.26302.118 + 11.0.100-preview.6.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 0.11.5-preview.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 + 11.0.0-beta.26302.118 3.2.2-beta.26257.113 - 2.9.3-beta.26257.113 - 11.0.0-beta.26257.113 - 5.8.0-1.26266.103 - 11.0.0-preview.5.26257.113 - 11.0.100-preview.5.26257.113 - 11.0.0-preview.5.26257.113 - 11.0.0-preview.5.26257.113 - 7.7.0-rc.25813 - 7.7.0-rc.25813 - 7.7.0-rc.25813 - 7.7.0-rc.25813 - 11.0.0-preview.5.26257.113 - 3.0.0-preview.5.26257.113 - 11.0.0-preview.5.26257.113 - 11.0.0-preview.5.26257.113 - 11.0.0-preview.5.26257.113 + 2.9.3-beta.26302.118 + 11.0.0-beta.26302.118 + 5.9.0-1.26302.118 + 11.0.0-preview.6.26302.118 + 11.0.100-preview.6.26302.118 + 11.0.0-preview.6.26302.118 + 11.0.0-preview.6.26302.118 + 7.9.0-rc.30318 + 7.9.0-rc.30318 + 7.9.0-rc.30318 + 7.9.0-rc.30318 + 11.0.0-preview.6.26302.118 + 3.0.0-preview.6.26302.118 + 11.0.0-preview.6.26302.118 + 11.0.0-preview.6.26302.118 + 11.0.0-preview.6.26302.118 11.0.0-alpha.0.26180.1 11.0.0-alpha.1.26281.1 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 - 19.1.0-alpha.1.26208.2 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 + 19.1.0-alpha.1.26256.1 - 11.0.0-alpha.1.26208.5 - 11.0.0-alpha.1.26208.5 - 11.0.0-alpha.1.26208.5 - 11.0.0-alpha.1.26208.5 - 11.0.0-alpha.1.26208.5 - 11.0.0-alpha.1.26208.5 - 11.0.0-alpha.1.26208.5 - 11.0.0-alpha.1.26208.5 + 11.0.0-alpha.1.26279.1 + 11.0.0-alpha.1.26279.1 + 11.0.0-alpha.1.26279.1 + 11.0.0-alpha.1.26279.1 + 11.0.0-alpha.1.26279.1 + 11.0.0-alpha.1.26279.1 + 11.0.0-alpha.1.26279.1 + 11.0.0-alpha.1.26279.1 1.0.0-prerelease.26276.2 1.0.0-prerelease.26276.2 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 81b34f1a08c5ba..5ea65f0f715ba2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,127 +1,127 @@ - + https://github.com/dotnet/icu d94093d6935a845e9a508e023ae1a94102a801b6 - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 https://github.com/dotnet/dotnet 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 https://github.com/dotnet/runtime-assets @@ -175,117 +175,117 @@ https://github.com/dotnet/runtime-assets 3d77251a3ee4b40d280dfc0f558f686e002a0f6d - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/llvm-project - db9a80a3e25e21268d55cf3385298dc03cfbed4d + 64a0a6a5130929ccaa47b52ad28997b7922920cc - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 https://github.com/dotnet/xharness @@ -299,9 +299,9 @@ https://github.com/dotnet/xharness 2cee83bf4841d72c9734a343f3003aeabdd46edf - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -327,33 +327,33 @@ https://github.com/dotnet/runtime-assets 3d77251a3ee4b40d280dfc0f558f686e002a0f6d - + https://github.com/dotnet/dotnet - 3a62cc842c76761d4742f1d103892f19fd06dd3a + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 3a62cc842c76761d4742f1d103892f19fd06dd3a + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 3a62cc842c76761d4742f1d103892f19fd06dd3a + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 3a62cc842c76761d4742f1d103892f19fd06dd3a + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 3a62cc842c76761d4742f1d103892f19fd06dd3a + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -365,53 +365,53 @@ - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/dotnet - 0eae08ed2f094f44e0151e4815e7cdd1a334fcdf + 6f5c5dc027109e572313690b0fc81dacbb2baba5 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 - + https://github.com/dotnet/node - cfe285c85ac61bde50792e8d516e31b302846f53 + 79236bbd235e8349185d4832bfc91ef372fa43f8 https://github.com/dotnet/runtime-assets diff --git a/eng/common/AGENTS.md b/eng/common/AGENTS.md new file mode 100644 index 00000000000000..a5ed8f72926d3d --- /dev/null +++ b/eng/common/AGENTS.md @@ -0,0 +1,5 @@ +# `eng/common` + +Files under `eng/common` come from [Arcade](https://github.com/dotnet/arcade). +Edits in `eng/common` will be overwritten by automation unless the changes are made directly in the Arcade repository. +For more information, see the [Arcade documentation](https://github.com/dotnet/arcade/tree/main/Documentation). diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index 18397a60eb85e0..4b4f6b0923f242 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -24,6 +24,7 @@ Param( [switch][Alias('pb')]$productBuild, [switch]$fromVMR, [switch][Alias('bl')]$binaryLog, + [string][Alias('bln')]$binaryLogName = '', [switch][Alias('nobl')]$excludeCIBinarylog, [switch] $ci, [switch] $prepareMachine, @@ -46,6 +47,7 @@ function Print-Usage() { Write-Host " -platform Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild" Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" Write-Host " -binaryLog Output binary log (short: -bl)" + Write-Host " -binaryLogName Binary log file name or path; implies -binaryLog (short: -bln)" Write-Host " -help Print help and exit" Write-Host "" @@ -102,7 +104,19 @@ function Build { $toolsetBuildProj = InitializeToolset InitializeCustomToolset - $bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' } + $bl = '' + if ($binaryLog) { + $binaryLogPath = if ([string]::IsNullOrEmpty($binaryLogName)) { + Join-Path $LogDir 'Build.binlog' + } elseif ([System.IO.Path]::IsPathRooted($binaryLogName)) { + $binaryLogName + } else { + Join-Path $LogDir $binaryLogName + } + + Create-Directory (Split-Path -Parent $binaryLogPath) + $bl = '/bl:' + $binaryLogPath + } $platformArg = if ($platform) { "/p:Platform=$platform" } else { '' } $check = if ($buildCheck) { '/check' } else { '' } @@ -162,6 +176,10 @@ try { $nodeReuse = $false } + if (-not [string]::IsNullOrEmpty($binaryLogName)) { + $binaryLog = $true + } + if ($nativeToolsOnMachine) { $env:NativeToolsOnMachine = $true } diff --git a/eng/common/build.sh b/eng/common/build.sh index 5883e53bcfb182..719ee4b58748d0 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -13,6 +13,7 @@ usage() echo " --configuration Build configuration: 'Debug' or 'Release' (short: -c)" echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" echo " --binaryLog Create MSBuild binary log (short: -bl)" + echo " --binaryLogName Binary log file name or path; implies --binaryLog (short: -bln)" echo " --help Print help and exit (short: -h)" echo "" @@ -83,8 +84,8 @@ warn_not_as_error='' node_reuse=true build_check=false binary_log=false +binary_log_name='' exclude_ci_binary_log=false -pipelines_log=false projects='' configuration='' @@ -115,12 +116,14 @@ while [[ $# -gt 0 ]]; do -binarylog|-bl) binary_log=true ;; + -binarylogname|-bln) + binary_log=true + binary_log_name=$2 + shift + ;; -excludecibinarylog|-nobl) exclude_ci_binary_log=true ;; - -pipelineslog|-pl) - pipelines_log=true - ;; -restore|-r) restore=true ;; @@ -210,7 +213,6 @@ if [[ -z "$configuration" ]]; then fi if [[ "$ci" == true ]]; then - pipelines_log=true node_reuse=false if [[ "$exclude_ci_binary_log" == false ]]; then binary_log=true @@ -237,7 +239,17 @@ function Build { local bl="" if [[ "$binary_log" == true ]]; then - bl="/bl:\"$log_dir/Build.binlog\"" + local binary_log_path="" + if [[ -z "$binary_log_name" ]]; then + binary_log_path="$log_dir/Build.binlog" + elif [[ "$binary_log_name" = /* ]]; then + binary_log_path="$binary_log_name" + else + binary_log_path="$log_dir/$binary_log_name" + fi + + mkdir -p "$(dirname "$binary_log_path")" + bl="/bl:\"$binary_log_path\"" fi local check="" diff --git a/eng/common/core-templates/job/helix-job-monitor.yml b/eng/common/core-templates/job/helix-job-monitor.yml new file mode 100644 index 00000000000000..767450da2fcb03 --- /dev/null +++ b/eng/common/core-templates/job/helix-job-monitor.yml @@ -0,0 +1,217 @@ +parameters: +# Maximum run time of the monitor job in minutes. Also used for --max-wait-minutes. +- name: timeoutInMinutes + type: number + default: 360 + +# Owner segment of the source repository (e.g. 'dotnet' for 'dotnet/runtime') passed via --organization. +# Defaults to the owner segment of BUILD_REPOSITORY_NAME when empty. +- name: organization + type: string + default: '' + +# Name of the source repository (e.g. 'runtime' for 'dotnet/runtime') passed via --repository. +# Defaults to the repo segment of BUILD_REPOSITORY_NAME when empty. +- name: repository + type: string + default: '' + +# Optional dependency list for the generated job. +- name: dependsOn + type: object + default: [] + +# Optional condition for the generated job. +- name: condition + type: string + default: '' + +# NuGet package id of the Helix job monitor tool. +- name: toolPackageId + type: string + default: Microsoft.DotNet.Helix.JobMonitor + +# Console command exposed by the installed tool package. +- name: toolCommand + type: string + default: dotnet-helix-job-monitor + +# Optional explicit tool version. Only honored when 'toolNupkgArtifactName' is set; in the +# default code path the version is taken from the consuming repo's .config/dotnet-tools.json. +- name: toolVersion + type: string + default: '' + +# Base URI for the Helix service (--helix-base-uri). +- name: helixBaseUri + type: string + default: https://helix.dot.net/ + +# Helix API access token forwarded to the tool via the HELIX_ACCESSTOKEN environment variable. +- name: helixAccessToken + type: string + default: '' + +# Polling interval in seconds (--polling-interval-seconds). +- name: pollingIntervalSeconds + type: number + default: 30 + +# Advanced: optional pipeline artifact (produced earlier in this run) that contains the tool +# nupkg. When set, the artifact is downloaded and the tool is installed from the nupkg into +# a local tool-path; this bypasses the repo's .config/dotnet-tools.json manifest and is +# primarily intended for the Arcade repository itself, where the Helix job monitor tool is +# built in the same pipeline that runs this template. +# +# When this parameter is empty (the default), the consuming repository must declare the tool +# in its .config/dotnet-tools.json manifest (alongside other local .NET tools); the template +# will check out the repo and run 'dotnet tool restore' to install the version pinned there. +- name: toolNupkgArtifactName + type: string + default: '' + +# Advanced: sub-path within the downloaded artifact where the tool nupkg is located. Defaults +# to the standard Arcade non-shipping packages location for a Release build (relative to the +# pipeline artifact root, which is itself the build's 'artifacts' directory). +- name: toolNupkgArtifactSubPath + type: string + default: 'packages/Release/NonShipping' + +jobs: +- job: HelixJobMonitor + displayName: Monitor Helix Jobs + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + ${{ if ne(length(parameters.dependsOn), 0) }}: + dependsOn: ${{ parameters.dependsOn }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + name: $(DncEngPublicBuildPool) + demands: ImageOverride -equals build.azurelinux.3.amd64.open + ${{ else }}: + name: $(DncEngInternalBuildPool) + demands: ImageOverride -equals build.azurelinux.3.amd64 + steps: + - checkout: self + fetchDepth: 1 + + - ${{ if ne(parameters.toolNupkgArtifactName, '') }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Helix Job Monitor artifact + inputs: + buildType: current + artifactName: ${{ parameters.toolNupkgArtifactName }} + itemPattern: '${{ parameters.toolNupkgArtifactSubPath }}/${{ parameters.toolPackageId }}.*.nupkg' + targetPath: $(Agent.TempDirectory)/helix-job-monitor-nupkg + + - bash: | + set -euo pipefail + + toolPath="$AGENT_TEMPDIRECTORY/helix-job-monitor-tool" + mkdir -p "$toolPath" + + packageId='${{ parameters.toolPackageId }}' + toolVersion='${{ parameters.toolVersion }}' + nupkgArtifactSubPath='${{ parameters.toolNupkgArtifactSubPath }}' + nupkgDir="$AGENT_TEMPDIRECTORY/helix-job-monitor-nupkg/$nupkgArtifactSubPath" + + if [ ! -d "$nupkgDir" ]; then + echo "Expected nupkg directory '$nupkgDir' was not produced by the artifact download." >&2 + exit 1 + fi + + nupkg=$(find "$nupkgDir" -maxdepth 1 -type f -name "$packageId.*.nupkg" | head -n 1) + if [ -z "$nupkg" ]; then + echo "No '$packageId.*.nupkg' found in '$nupkgDir'." >&2 + exit 1 + fi + + # Derive the version from the nupkg filename so the local package is selected + # deterministically instead of resolving against any other configured feed. + nupkgBase=$(basename "$nupkg" .nupkg) + derivedVersion="${nupkgBase#${packageId}.}" + if [ -z "$toolVersion" ]; then + toolVersion="$derivedVersion" + fi + + echo "Using locally built '$packageId' version '$toolVersion' from '$nupkgDir'." + + # Create a minimal NuGet.config that only references the local nupkg directory. + # This avoids conflicts with the repo's package source mapping which blocks --add-source. + toolNugetConfig="$AGENT_TEMPDIRECTORY/helix-job-monitor-nuget.config" + printf '\n\n \n \n \n \n\n' "$nupkgDir" > "$toolNugetConfig" + + pushd "$(Build.SourcesDirectory)" > /dev/null + ./eng/common/dotnet.sh tool install \ + --tool-path "$toolPath" "$packageId" \ + --version "$toolVersion" \ + --configfile "$toolNugetConfig" + + # Locate the tool DLL so the run step can invoke it via ./eng/common/dotnet.sh exec. + toolDll=$(find "$toolPath/.store" -path '*/tools/*/any/*.deps.json' -type f | head -n 1) + toolDll="${toolDll%.deps.json}.dll" + if [ ! -f "$toolDll" ]; then + echo "Could not find tool DLL in '$toolPath/.store'." >&2 + exit 1 + fi + + echo "Tool DLL: $toolDll" + echo "##vso[task.setvariable variable=HelixJobMonitorDll]$toolDll" + displayName: Install Helix Job Monitor + + - ${{ else }}: + - bash: ./eng/common/dotnet.sh tool restore + displayName: Restore Helix Job Monitor + + - bash: | + set -euo pipefail + + toolArgs=( + --helix-base-uri '${{ parameters.helixBaseUri }}' + --polling-interval-seconds '${{ parameters.pollingIntervalSeconds }}' + --max-wait-minutes "$((${{ parameters.timeoutInMinutes }} - 2))" # Set the tool's timeout slightly lower than the Azure DevOps job timeout to allow it to exit gracefully. + --stage-name '$(System.StageName)' + ) + + organization='${{ parameters.organization }}' + repository='${{ parameters.repository }}' + + # Fall back to Azure DevOps-provided environment variables when the caller did not + # supply organization / repository explicitly. BUILD_REPOSITORY_NAME is typically + # 'owner/repo' for GitHub-backed builds. + if [ -z "$organization" ] || [ -z "$repository" ]; then + buildRepoName="${BUILD_REPOSITORY_NAME:-}" + if [ -n "$buildRepoName" ] && [[ "$buildRepoName" == */* ]]; then + repoOwner="${buildRepoName%%/*}" + repoName="${buildRepoName#*/}" + if [ -z "$organization" ]; then organization="$repoOwner"; fi + if [ -z "$repository" ]; then repository="$repoName"; fi + fi + fi + + if [ -n "$organization" ]; then toolArgs+=( --organization "$organization" ); fi + if [ -n "$repository" ]; then toolArgs+=( --repository "$repository" ); fi + + # Build.Reason and Build.SourceBranch are required to derive the Helix source filter + # the same way the Helix SDK submitter does (PR -> 'pr', internal -> 'official', + # otherwise -> 'ci'). Without these, manually-queued / scheduled / CI builds would + # be looked up under the wrong source prefix and find zero jobs. + toolArgs+=( --build-reason "$(Build.Reason)" ) + toolArgs+=( --source-branch "$(Build.SourceBranch)" ) + + if [ -n '${{ parameters.toolNupkgArtifactName }}' ]; then + # Tool was installed from a local nupkg; run the DLL via the repo-local dotnet. + export DOTNET_ROOT="$(Build.SourcesDirectory)/.dotnet" + ./eng/common/dotnet.sh exec "$(HelixJobMonitorDll)" "${toolArgs[@]}" + else + # Tool was restored from the local .config/dotnet-tools.json manifest; invoke it + # through the manifest from the repo root. + pushd "$BUILD_SOURCESDIRECTORY" > /dev/null + trap 'popd > /dev/null' EXIT + ./eng/common/dotnet.sh tool run '${{ parameters.toolCommand }}' -- "${toolArgs[@]}" + fi + displayName: Monitor Helix Jobs + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + HELIX_ACCESSTOKEN: ${{ parameters.helixAccessToken }} diff --git a/eng/common/core-templates/job/onelocbuild.yml b/eng/common/core-templates/job/onelocbuild.yml index eefed3b667a4fb..86ea9f63504243 100644 --- a/eng/common/core-templates/job/onelocbuild.yml +++ b/eng/common/core-templates/job/onelocbuild.yml @@ -22,6 +22,7 @@ parameters: GitHubOrg: dotnet MirrorRepo: '' MirrorBranch: main + xLocCustomPowerShellScript: '' condition: '' JobNameSuffix: '' is1ESPipeline: '' @@ -97,6 +98,8 @@ jobs: gitHubOrganization: ${{ parameters.GitHubOrg }} mirrorRepo: ${{ parameters.MirrorRepo }} mirrorBranch: ${{ parameters.MirrorBranch }} + ${{ if ne(parameters.xLocCustomPowerShellScript, '') }}: + xLocCustomPowerShellScript: ${{ parameters.xLocCustomPowerShellScript }} condition: ${{ parameters.condition }} # Copy the locProject.json to the root of the Loc directory, then publish a pipeline artifact diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index 84a1922c73f392..2731e48cce4563 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -33,10 +33,6 @@ steps: '$(publishing-dnceng-devdiv-code-r-build-re)' '$(dn-bot-all-orgs-artifact-feeds-rw)' '$(akams-client-id)' - '$(microsoft-symbol-server-pat)' - '$(symweb-symbol-server-pat)' - '$(dnceng-symbol-server-pat)' - '$(dn-bot-all-orgs-build-rw-code-rw)' '$(System.AccessToken)' ${{parameters.CustomSensitiveDataList}} continueOnError: true diff --git a/eng/common/core-templates/steps/source-index-stage1-publish.yml b/eng/common/core-templates/steps/source-index-stage1-publish.yml index 3ad83b8c3075e3..fdca622357f380 100644 --- a/eng/common/core-templates/steps/source-index-stage1-publish.yml +++ b/eng/common/core-templates/steps/source-index-stage1-publish.yml @@ -1,15 +1,15 @@ parameters: - sourceIndexUploadPackageVersion: 2.0.0-20250906.1 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20250906.1 + sourceIndexUploadPackageVersion: 2.0.0-20260521.2 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20260521.2 sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json binlogPath: artifacts/log/Debug/Build.binlog steps: - task: UseDotNet@2 - displayName: "Source Index: Use .NET 9 SDK" + displayName: "Source Index: Use .NET 10 SDK" inputs: packageType: sdk - version: 9.0.x + version: 10.0.x installationPath: $(Agent.TempDirectory)/dotnet workingDirectory: $(Agent.TempDirectory) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 314c93c57598d8..f06854ccc1865e 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -5,7 +5,7 @@ set -e usage() { echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir ]" - echo "BuildArch can be: arm(default), arm64, armel, armv6, loongarch64, ppc64le, riscv64, s390x, x64, x86" + echo "BuildArch can be: arm(default), arm64, loongarch64, ppc64le, riscv64, s390x, x64, x86" echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine" echo " for alpine can be specified with version: alpineX.YY or alpineedge" echo " for FreeBSD can be: freebsd13, freebsd14" @@ -76,7 +76,7 @@ __AlpinePackages+=" openssl-dev" __AlpinePackages+=" zlib-dev" __FreeBSDBase="13.5-RELEASE" -__FreeBSDPkg="1.21.3" +__FreeBSDPkg="2.7.5" __FreeBSDABI="13" __FreeBSDPackages="libunwind" __FreeBSDPackages+=" icu" @@ -139,7 +139,6 @@ __AlpineKeys=' 616db30d:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpUpyWDWjlUk3smlWeA0\nlIMW+oJ38t92CRLHH3IqRhyECBRW0d0aRGtq7TY8PmxjjvBZrxTNDpJT6KUk4LRm\na6A6IuAI7QnNK8SJqM0DLzlpygd7GJf8ZL9SoHSH+gFsYF67Cpooz/YDqWrlN7Vw\ntO00s0B+eXy+PCXYU7VSfuWFGK8TGEv6HfGMALLjhqMManyvfp8hz3ubN1rK3c8C\nUS/ilRh1qckdbtPvoDPhSbTDmfU1g/EfRSIEXBrIMLg9ka/XB9PvWRrekrppnQzP\nhP9YE3x/wbFc5QqQWiRCYyQl/rgIMOXvIxhkfe8H5n1Et4VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ== 66ba20fe:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtfB12w4ZgqsXWZDfUAV/\n6Y4aHUKIu3q4SXrNZ7CXF9nXoAVYrS7NAxJdAodsY3vPCN0g5O8DFXR+390LdOuQ\n+HsGKCc1k5tX5ZXld37EZNTNSbR0k+NKhd9h6X3u6wqPOx7SIKxwAQR8qeeFq4pP\nrt9GAGlxtuYgzIIcKJPwE0dZlcBCg+GnptCUZXp/38BP1eYC+xTXSL6Muq1etYfg\nodXdb7Yl+2h1IHuOwo5rjgY5kpY7GcAs8AjGk3lDD/av60OTYccknH0NCVSmPoXK\nvrxDBOn0LQRNBLcAfnTKgHrzy0Q5h4TNkkyTgxkoQw5ObDk9nnabTxql732yy9BY\ns+hM9+dSFO1HKeVXreYSA2n1ndF18YAvAumzgyqzB7I4pMHXq1kC/8bONMJxwSkS\nYm6CoXKyavp7RqGMyeVpRC7tV+blkrrUml0BwNkxE+XnwDRB3xDV6hqgWe0XrifD\nYTfvd9ScZQP83ip0r4IKlq4GMv/R5shcCRJSkSZ6QSGshH40JYSoiwJf5FHbj9ND\n7do0UAqebWo4yNx63j/wb2ULorW3AClv0BCFSdPsIrCStiGdpgJDBR2P2NZOCob3\nG9uMj+wJD6JJg2nWqNJxkANXX37Qf8plgzssrhrgOvB0fjjS7GYhfkfmZTJ0wPOw\nA8+KzFseBh4UFGgue78KwgkCAwEAAQ== ' -__Keyring= __KeyringFile="/usr/share/keyrings/ubuntu-archive-keyring.gpg" __SkipSigCheck=0 __SkipEmulation=0 @@ -162,6 +161,10 @@ while :; do __AlpineArch=armv7 __QEMUArch=arm ;; + armel) + # this is only used for tizen-build-rootfs.sh + __BuildArch=armel + ;; arm64) __BuildArch=arm64 __UbuntuArch=arm64 @@ -172,31 +175,6 @@ while :; do __OpenBSDArch=arm64 __OpenBSDMachineArch=aarch64 ;; - armel) - __BuildArch=armel - __UbuntuArch=armel - __UbuntuRepo="http://archive.debian.org/debian/" - __CodeName=buster - __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" - __LLDB_Package="liblldb-6.0-dev" - __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" - __UbuntuPackages="${__UbuntuPackages// libomp5/}" - __UbuntuSuites= - ;; - armv6) - __BuildArch=armv6 - __UbuntuArch=armhf - __QEMUArch=arm - __UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/" - __CodeName=buster - __KeyringFile="/usr/share/keyrings/raspbian-archive-keyring.gpg" - __LLDB_Package="liblldb-6.0-dev" - __UbuntuSuites= - - if [[ -e "$__KeyringFile" ]]; then - __Keyring="--keyring $__KeyringFile" - fi - ;; loongarch64) __BuildArch=loongarch64 __AlpineArch=loongarch64 @@ -204,10 +182,6 @@ while :; do __UbuntuArch=loong64 __UbuntuSuites=unreleased __LLDB_Package="liblldb-19-dev" - - if [[ "$__CodeName" == "sid" ]]; then - __UbuntuRepo="http://ftp.ports.debian.org/debian-ports/" - fi ;; riscv64) __BuildArch=riscv64 @@ -223,7 +197,7 @@ while :; do __AlpineArch=ppc64le __QEMUArch=ppc64le __UbuntuArch=ppc64el - __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" + __UbuntuRepo="https://ports.ubuntu.com/ubuntu-ports/" __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" __UbuntuPackages="${__UbuntuPackages// libomp5/}" @@ -234,7 +208,7 @@ while :; do __AlpineArch=s390x __QEMUArch=s390x __UbuntuArch=s390x - __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" + __UbuntuRepo="https://ports.ubuntu.com/ubuntu-ports/" __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" __UbuntuPackages="${__UbuntuPackages// libomp5/}" @@ -250,13 +224,13 @@ while :; do __OpenBSDMachineArch=amd64 __illumosArch=x86_64 __HaikuArch=x86_64 - __UbuntuRepo="http://archive.ubuntu.com/ubuntu/" + __UbuntuRepo="https://archive.ubuntu.com/ubuntu/" ;; x86) __BuildArch=x86 __UbuntuArch=i386 __AlpineArch=x86 - __UbuntuRepo="http://archive.ubuntu.com/ubuntu/" + __UbuntuRepo="https://archive.ubuntu.com/ubuntu/" ;; lldb*) version="$(echo "$lowerI" | tr -d '[:alpha:]-=')" @@ -316,7 +290,7 @@ while :; do __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.debian.org/debian/" + __UbuntuRepo="https://archive.debian.org/debian/" fi ;; buster) # Debian 10 @@ -325,7 +299,7 @@ while :; do __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://archive.debian.org/debian/" + __UbuntuRepo="https://archive.debian.org/debian/" fi ;; bullseye) # Debian 11 @@ -333,7 +307,7 @@ while :; do __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.debian.org/debian/" + __UbuntuRepo="https://ftp.debian.org/debian/" fi ;; bookworm) # Debian 12 @@ -341,7 +315,7 @@ while :; do __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.debian.org/debian/" + __UbuntuRepo="https://ftp.debian.org/debian/" fi ;; sid) # Debian sid @@ -350,25 +324,21 @@ while :; do # Debian-Ports architectures need different values case "$__UbuntuArch" in - amd64|arm64|armel|armhf|i386|mips64el|ppc64el|riscv64|s390x) + amd64|arm64|armhf|i386|mips64el|ppc64el|riscv64|s390x) __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.debian.org/debian/" + __UbuntuRepo="https://ftp.debian.org/debian/" fi ;; *) __KeyringFile="/usr/share/keyrings/debian-ports-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.ports.debian.org/debian-ports/" + __UbuntuRepo="https://ftp.debian.org/debian-ports/" fi ;; esac - - if [[ -e "$__KeyringFile" ]]; then - __Keyring="--keyring $__KeyringFile" - fi ;; tizen) __CodeName= @@ -472,7 +442,7 @@ fi __UbuntuPackages+=" ${__LLDB_Package:-}" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ports.ubuntu.com/" + __UbuntuRepo="https://ports.ubuntu.com/" fi if [[ -n "$__LLVM_MajorVersion" ]]; then @@ -559,15 +529,15 @@ if [[ "$__CodeName" == "alpine" ]]; then # initialize DB # shellcheck disable=SC2086 "$__ApkToolsDir/apk.static" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ + -X "https://dl-cdn.alpinelinux.org/alpine/$version/main" \ + -X "https://dl-cdn.alpinelinux.org/alpine/$version/community" \ -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" --initdb add if [[ "$__AlpineLlvmLibsLookup" == 1 ]]; then # shellcheck disable=SC2086 __AlpinePackages+=" $("$__ApkToolsDir/apk.static" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ + -X "https://dl-cdn.alpinelinux.org/alpine/$version/main" \ + -X "https://dl-cdn.alpinelinux.org/alpine/$version/community" \ -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" \ search 'llvm*-libs' | grep -E '^llvm' | sort | tail -1 | sed 's/-[^-]*//2g')" fi @@ -575,8 +545,8 @@ if [[ "$__CodeName" == "alpine" ]]; then # install all packages in one go # shellcheck disable=SC2086 "$__ApkToolsDir/apk.static" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ - -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ + -X "https://dl-cdn.alpinelinux.org/alpine/$version/main" \ + -X "https://dl-cdn.alpinelinux.org/alpine/$version/community" \ -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" $__NoEmulationArg \ add $__AlpinePackages @@ -593,7 +563,7 @@ elif [[ "$__CodeName" == "freebsd" ]]; then curl -SL "https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz" | tar -C "$__RootfsDir" -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version fi echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > "${__RootfsDir}"/usr/local/etc/pkg.conf - echo "FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"/usr/share/keys/pkg\", enabled: yes }" > "${__RootfsDir}"/etc/pkg/FreeBSD.conf + echo "FreeBSD: { url: \"pkg+https://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"/usr/share/keys/pkg\", enabled: yes }" > "${__RootfsDir}"/etc/pkg/FreeBSD.conf mkdir -p "$__RootfsDir"/tmp # get and build package manager if [[ "$__hasWget" == 1 ]]; then @@ -607,7 +577,7 @@ elif [[ "$__CodeName" == "freebsd" ]]; then ./autogen.sh && ./configure --prefix="$__RootfsDir"/host && make -j "$JOBS" && make install rm -rf "$__RootfsDir/tmp/pkg-${__FreeBSDPkg}" # install packages we need. - INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf update + INSTALL_AS_USER=$(whoami) IGNORE_OSVERSION=yes "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf update # shellcheck disable=SC2086 INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages elif [[ "$__CodeName" == "openbsd" ]]; then @@ -830,6 +800,14 @@ elif [[ "$__CodeName" == "haiku" ]]; then elif [[ -n "$__CodeName" ]]; then __Suites="$__CodeName $(for suite in $__UbuntuSuites; do echo -n "$__CodeName-$suite "; done)" + __SigCheckArgs= + if [[ "$__SkipSigCheck" == "0" ]]; then + if [[ -e "$__KeyringFile" ]]; then + __SigCheckArgs="--keyring $__KeyringFile" + fi + __SigCheckArgs="$__SigCheckArgs --force-check-gpg" + fi + if [[ "$__SkipEmulation" == "1" ]]; then if [[ -z "$AR" ]]; then if command -v ar &>/dev/null; then @@ -845,31 +823,23 @@ elif [[ -n "$__CodeName" ]]; then PYTHON=${PYTHON_EXECUTABLE:-python3} # shellcheck disable=SC2086,SC2046 - echo running "$PYTHON" "$__CrossDir/install-debs.py" --arch "$__UbuntuArch" --mirror "$__UbuntuRepo" --rootfsdir "$__RootfsDir" --artool "$AR" \ + echo running "$PYTHON" "$__CrossDir/install-debs.py" $__SigCheckArgs --arch "$__UbuntuArch" --mirror "$__UbuntuRepo" --rootfsdir "$__RootfsDir" --artool "$AR" \ $(for suite in $__Suites; do echo -n "--suite $suite "; done) \ $__UbuntuPackages # shellcheck disable=SC2086,SC2046 - "$PYTHON" "$__CrossDir/install-debs.py" --arch "$__UbuntuArch" --mirror "$__UbuntuRepo" --rootfsdir "$__RootfsDir" --artool "$AR" \ + "$PYTHON" "$__CrossDir/install-debs.py" $__SigCheckArgs --arch "$__UbuntuArch" --mirror "$__UbuntuRepo" --rootfsdir "$__RootfsDir" --artool "$AR" \ $(for suite in $__Suites; do echo -n "--suite $suite "; done) \ $__UbuntuPackages exit 0 fi - __UpdateOptions= - if [[ "$__SkipSigCheck" == "0" ]]; then - __Keyring="$__Keyring --force-check-gpg" - else - __Keyring= - __UpdateOptions="--allow-unauthenticated --allow-insecure-repositories" - fi - # shellcheck disable=SC2086 - echo running debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" + echo running debootstrap "--variant=minbase" $__SigCheckArgs --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" # shellcheck disable=SC2086 - if ! debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"; then + if ! debootstrap "--variant=minbase" $__SigCheckArgs --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"; then echo "debootstrap failed! dumping debootstrap.log" cat "$__RootfsDir/debootstrap/debootstrap.log" exit 1 @@ -887,6 +857,11 @@ Components: main universe Signed-By: $__KeyringFile EOF + __UpdateOptions= + if [[ "$__SkipSigCheck" == "1" ]]; then + __UpdateOptions="--allow-unauthenticated --allow-insecure-repositories" + fi + # shellcheck disable=SC2086 chroot "$__RootfsDir" apt-get update $__UpdateOptions chroot "$__RootfsDir" apt-get -f -y install diff --git a/eng/common/cross/install-debs.py b/eng/common/cross/install-debs.py index c81eb37e522efc..20ca770a1e21fc 100755 --- a/eng/common/cross/install-debs.py +++ b/eng/common/cross/install-debs.py @@ -4,6 +4,7 @@ import asyncio import aiohttp import gzip +import hashlib import os import re import shutil @@ -16,7 +17,7 @@ from collections import deque from functools import cmp_to_key -async def download_file(session, url, dest_path, max_retries=3, retry_delay=2, timeout=60): +async def download_file(session, url, dest_path, max_retries=3, retry_delay=2, timeout=60, checksum=None): """Asynchronous file download with retries.""" attempt = 0 while attempt < max_retries: @@ -25,19 +26,25 @@ async def download_file(session, url, dest_path, max_retries=3, retry_delay=2, t if response.status == 200: with open(dest_path, "wb") as f: content = await response.read() + + # verify checksum if provided + if checksum: + sha256 = hashlib.sha256(content).hexdigest() + if sha256 != checksum: + raise Exception(f"SHA256 mismatch for {url}: expected {checksum}, got {sha256}") + f.write(content) print(f"Downloaded {url} at {dest_path}") return else: - print(f"Failed to download {url}, Status Code: {response.status}") - break + raise Exception(f"Failed to download {url}, Status Code: {response.status}") except (asyncio.CancelledError, asyncio.TimeoutError, aiohttp.ClientError) as e: print(f"Error downloading {url}: {type(e).__name__} - {e}. Retrying...") attempt += 1 await asyncio.sleep(retry_delay) - print(f"Failed to download {url} after {max_retries} attempts.") + raise Exception(f"Failed to download {url} after {max_retries} attempts.") async def download_deb_files_parallel(mirror, packages, tmp_dir): """Download .deb files in parallel.""" @@ -51,11 +58,11 @@ async def download_deb_files_parallel(mirror, packages, tmp_dir): if filename: url = f"{mirror}/{filename}" dest_path = os.path.join(tmp_dir, os.path.basename(filename)) - tasks.append(asyncio.create_task(download_file(session, url, dest_path))) + tasks.append(asyncio.create_task(download_file(session, url, dest_path, checksum=info.get("SHA256")))) await asyncio.gather(*tasks) -async def download_package_index_parallel(mirror, arch, suites): +async def download_package_index_parallel(mirror, arch, suites, check_sig, keyring): """Download package index files for specified suites and components entirely in memory.""" tasks = [] timeout = aiohttp.ClientTimeout(total=60) @@ -63,10 +70,9 @@ async def download_package_index_parallel(mirror, arch, suites): async with aiohttp.ClientSession(timeout=timeout) as session: for suite in suites: for component in ["main", "universe"]: - url = f"{mirror}/dists/{suite}/{component}/binary-{arch}/Packages.gz" - tasks.append(fetch_and_decompress(session, url)) + tasks.append(fetch_and_decompress(session, mirror, arch, suite, component, check_sig, keyring)) - results = await asyncio.gather(*tasks, return_exceptions=True) + results = await asyncio.gather(*tasks) merged_content = "" for result in results: @@ -77,20 +83,71 @@ async def download_package_index_parallel(mirror, arch, suites): return merged_content -async def fetch_and_decompress(session, url): +async def fetch_and_decompress(session, mirror, arch, suite, component, check_sig, keyring): """Fetch and decompress the Packages.gz file.""" - try: - async with session.get(url) as response: - if response.status == 200: - compressed_data = await response.read() - decompressed_data = gzip.decompress(compressed_data).decode('utf-8') - print(f"Downloaded index: {url}") - return decompressed_data - else: - print(f"Skipped index: {url} (doesn't exist)") - return None - except Exception as e: - print(f"Error fetching {url}: {e}") + + path = f"{component}/binary-{arch}/Packages.gz" + url = f"{mirror}/dists/{suite}/{path}" + + async with session.get(url) as response: + if response.status == 200: + compressed_data = await response.read() + decompressed_data = gzip.decompress(compressed_data).decode('utf-8') + print(f"Downloaded index: {url}") + + if check_sig: + # Verify the package index against the sha256 recorded in the Release file + release_file_content = await fetch_release_file(session, mirror, suite, keyring) + packages_sha = parse_release_file(release_file_content, path) + + sha256 = hashlib.sha256(compressed_data).hexdigest() + if sha256 != packages_sha: + raise Exception(f"SHA256 mismatch for {path}: expected {packages_sha}, got {sha256}") + print(f"Checksum verified for {path}") + + return decompressed_data + else: + print(f"Skipped index: {url} (doesn't exist)") + return None + +async def fetch_release_file(session, mirror, suite, keyring): + """Fetch Release and Release.gpg files and verify the signature.""" + + release_url = f"{mirror}/dists/{suite}/Release" + release_gpg_url = f"{mirror}/dists/{suite}/Release.gpg" + + with tempfile.NamedTemporaryFile() as release_file, tempfile.NamedTemporaryFile() as release_gpg_file: + await download_file(session, release_url, release_file.name) + await download_file(session, release_gpg_url, release_gpg_file.name) + + print("Verifying signature of Release with Release.gpg.") + verify_command = ["gpg"] + if keyring: + verify_command += ["--keyring", keyring] + verify_command += ["--verify", release_gpg_file.name, release_file.name] + result = subprocess.run(verify_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + if result.returncode != 0: + raise Exception(f"Signature verification failed: {result.stderr.decode('utf-8')}") + + print("Signature verified successfully.") + + with open(release_file.name) as f: + return f.read() + +def parse_release_file(content, path): + """Parses the Release file and returns sha256 checksum of the specified path.""" + + # data looks like this: + # + matches = re.findall(r'^ (\S*) +(\S*) +(\S*)$', content, re.MULTILINE) + + for entry in matches: + # the file has both md5 and sha256 checksums, we want sha256 which has a length of 64 + if entry[2] == path and len(entry[0]) == 64: + return entry[0] + + raise Exception(f"Could not find checksum for {path} in Release file.") def parse_debian_version(version): """Parse a Debian package version into epoch, upstream version, and revision.""" @@ -171,13 +228,15 @@ def parse_package_index(content): filename = fields.get("Filename") depends = fields.get("Depends") provides = fields.get("Provides", None) + sha256 = fields.get("SHA256") # Only update if package_name is not in packages or if the new version is higher if package_name not in packages or compare_debian_versions(version, packages[package_name]["Version"]) > 0: packages[package_name] = { "Version": version, "Filename": filename, - "Depends": depends + "Depends": depends, + "SHA256": sha256 } # Update aliases if package provides any alternatives @@ -233,7 +292,7 @@ def extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool): os.makedirs(extract_dir, exist_ok=True) with tempfile.TemporaryDirectory(dir=tmp_dir) as tmp_subdir: - result = subprocess.run(f"{ar_tool} t {os.path.abspath(deb_file)}", cwd=tmp_subdir, check=True, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + result = subprocess.run([ar_tool, "t", os.path.abspath(deb_file)], cwd=tmp_subdir, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) tar_filename = None for line in result.stdout.decode().splitlines(): @@ -247,7 +306,8 @@ def extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool): tar_file_path = os.path.join(tmp_subdir, tar_filename) print(f"Extracting {tar_filename} from {deb_file}..") - subprocess.run(f"{ar_tool} p {os.path.abspath(deb_file)} {tar_filename} > {tar_file_path}", check=True, shell=True) + with open(tar_file_path, "wb") as outfile: + subprocess.run([ar_tool, "p", os.path.abspath(deb_file), tar_filename], check=True, stdout=outfile, stderr=subprocess.PIPE) file_extension = os.path.splitext(tar_file_path)[1].lower() @@ -268,7 +328,18 @@ def extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool): raise ValueError(f"Unsupported compression format: {file_extension}") with tarfile.open(tar_file_path, mode) as tar: - tar.extractall(path=extract_dir, filter='fully_trusted') + tar.extractall(path=extract_dir, filter=_rootfs_extraction_filter) + +def _rootfs_extraction_filter(member, dest_path): + """Tarfile extraction filter based on the 'data' filter that additionally + rewrites absolute-target symlinks/hardlinks into rootfs-relative paths. + """ + if (member.issym() or member.islnk()) and os.path.isabs(member.linkname): + link_dir = os.path.dirname(member.name) + new_linkname = os.path.relpath(member.linkname.lstrip('/'), + start=link_dir or '.') + member = member.replace(linkname=new_linkname, deep=False) + return tarfile.data_filter(member, dest_path) def finalize_setup(rootfsdir): lib_dir = os.path.join(rootfsdir, 'lib') @@ -295,24 +366,17 @@ def finalize_setup(rootfsdir): if __name__ == "__main__": parser = argparse.ArgumentParser(description="Generate rootfs for .NET runtime on Debian-like OS") - parser.add_argument("--distro", required=False, help="Distro name (e.g., debian, ubuntu, etc.)") parser.add_argument("--arch", required=True, help="Architecture (e.g., amd64, loong64, etc.)") parser.add_argument("--rootfsdir", required=True, help="Destination directory.") parser.add_argument('--suite', required=True, action='append', help='Specify one or more repository suites to collect index data.') - parser.add_argument("--mirror", required=False, help="Mirror (e.g., http://ftp.debian.org/debian-ports etc.)") + parser.add_argument("--mirror", required=True, help="Mirror (e.g., http://ftp.debian.org/debian-ports etc.)") parser.add_argument("--artool", required=False, default="ar", help="ar tool to extract debs (e.g., ar, llvm-ar etc.)") + parser.add_argument("--force-check-gpg", required=False, action='store_true', help="Verify the packages against signatures in Release file.") + parser.add_argument("--keyring", required=False, default='', help="Keyring file to check signature of Release file.") parser.add_argument("packages", nargs="+", help="List of package names to be installed.") args = parser.parse_args() - if args.mirror is None: - if args.distro == "ubuntu": - args.mirror = "http://archive.ubuntu.com/ubuntu" if args.arch in ["amd64", "i386"] else "http://ports.ubuntu.com/ubuntu-ports" - elif args.distro == "debian": - args.mirror = "http://ftp.debian.org/debian-ports" - else: - raise Exception("Unsupported distro") - DESIRED_PACKAGES = args.packages + [ # base packages "dpkg", "busybox", @@ -322,9 +386,16 @@ def finalize_setup(rootfsdir): "debianutils" ] - print(f"Creating rootfs. rootfsdir: {args.rootfsdir}, distro: {args.distro}, arch: {args.arch}, suites: {args.suite}, mirror: {args.mirror}") + print(f"Creating rootfs. rootfsdir: {args.rootfsdir}, arch: {args.arch}, suites: {args.suite}, mirror: {args.mirror}") + + check_sig = args.force_check_gpg + if check_sig and not args.keyring: + print("ERROR: --force-check-gpg requires --keyring to specify a keyring file for signature verification.") + print("Install the appropriate keyring package (e.g., debian-ports-archive-keyring, ubuntu-archive-keyring)") + print("or pass --skipsigcheck to build-rootfs.sh to disable signature checking.") + sys.exit(1) - package_index_content = asyncio.run(download_package_index_parallel(args.mirror, args.arch, args.suite)) + package_index_content = asyncio.run(download_package_index_parallel(args.mirror, args.arch, args.suite, check_sig, args.keyring)) packages_info, aliases = parse_package_index(package_index_content) diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index ff2dfdb4a5bf60..99d6dfe82dde38 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -225,13 +225,19 @@ elseif(ILLUMOS) locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) elseif(HAIKU) set(CMAKE_SYSROOT "${CROSS_ROOTFS}") - set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};${CROSS_ROOTFS}/cross-tools-x86_64/bin") set(CMAKE_SYSTEM_PREFIX_PATH "${CROSS_ROOTFS}") set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") - locate_toolchain_exec(gcc CMAKE_C_COMPILER) - locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) + if ($ENV{CCC_CC} MATCHES ".*gcc.*") + set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};${CROSS_ROOTFS}/cross-tools-x86_64/bin") + locate_toolchain_exec(gcc CMAKE_C_COMPILER) + locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) + else() + set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/cross-tools-x86_64") + set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/cross-tools-x86_64") + set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "${CROSS_ROOTFS}/cross-tools-x86_64") + endif() # let CMake set up the correct search paths include(Platform/Haiku) diff --git a/eng/common/dotnet-install.ps1 b/eng/common/dotnet-install.ps1 index 811f0f717f736a..50ae62737687c5 100644 --- a/eng/common/dotnet-install.ps1 +++ b/eng/common/dotnet-install.ps1 @@ -10,7 +10,11 @@ Param( . $PSScriptRoot\tools.ps1 -$dotnetRoot = Join-Path $RepoRoot '.dotnet' +if (-not [string]::IsNullOrEmpty($env:DOTNET_GLOBAL_INSTALL_DIR)) { + $dotnetRoot = $env:DOTNET_GLOBAL_INSTALL_DIR +} else { + $dotnetRoot = Join-Path $RepoRoot '.dotnet' +} $installdir = $dotnetRoot try { diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh index 61f302bb677560..1cb3f5abac2864 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -80,7 +80,11 @@ case $cpuname in ;; esac -dotnetRoot="${repo_root}.dotnet" +if [[ -n "${DOTNET_GLOBAL_INSTALL_DIR:-}" ]]; then + dotnetRoot="$DOTNET_GLOBAL_INSTALL_DIR" +else + dotnetRoot="${repo_root}.dotnet" +fi if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then dotnetRoot="$dotnetRoot/$architecture" fi diff --git a/eng/common/native/install-dependencies.sh b/eng/common/native/install-dependencies.sh index 4742177a7685d5..aff839fa097485 100755 --- a/eng/common/native/install-dependencies.sh +++ b/eng/common/native/install-dependencies.sh @@ -24,16 +24,16 @@ case "$os" in apt update apt install -y build-essential gettext locales cmake llvm clang lld lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \ - libssl-dev libkrb5-dev pigz cpio ninja-build + libssl-dev libkrb5-dev pigz cpio ninja-build file localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 elif [ "$ID" = "fedora" ] || [ "$ID" = "rhel" ] || [ "$ID" = "azurelinux" ] || [ "$ID" = "centos" ]; then pkg_mgr="$(command -v tdnf 2>/dev/null || command -v dnf)" - $pkg_mgr install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio ninja-build + $pkg_mgr install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio ninja-build file elif [ "$ID" = "amzn" ]; then - dnf install -y cmake llvm lld lldb clang python libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio ninja-build + dnf install -y cmake llvm lld lldb clang python libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio ninja-build file elif [ "$ID" = "alpine" ]; then - apk add build-base cmake bash curl clang llvm llvm-dev lld lldb-dev krb5-dev lttng-ust-dev icu-dev openssl-dev pigz cpio ninja + apk add build-base cmake bash curl clang llvm llvm-dev lld lldb-dev krb5-dev lttng-ust-dev icu-dev openssl-dev pigz cpio ninja file else echo "Unsupported distro. distro: $ID" exit 1 diff --git a/eng/common/pipeline-logging-functions.ps1 b/eng/common/pipeline-logging-functions.ps1 index 8e422c561e4bdb..9f85c291708b38 100644 --- a/eng/common/pipeline-logging-functions.ps1 +++ b/eng/common/pipeline-logging-functions.ps1 @@ -32,7 +32,7 @@ function Write-PipelineTelemetryError { $PSBoundParameters.Remove('Category') | Out-Null if ($Force -Or ((Test-Path variable:ci) -And $ci)) { - $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" + $Message = "($Category) $Message" } $PSBoundParameters.Remove('Message') | Out-Null $PSBoundParameters.Add('Message', $Message) diff --git a/eng/common/templates/steps/vmr-sync.yml b/eng/common/templates/steps/vmr-sync.yml index eb619c5026837a..cdc6a28ff1f660 100644 --- a/eng/common/templates/steps/vmr-sync.yml +++ b/eng/common/templates/steps/vmr-sync.yml @@ -45,11 +45,11 @@ steps: workingDirectory: ${{ parameters.vmrPath }} - script: | - ./eng/common/vmr-sync.sh \ - --vmr ${{ parameters.vmrPath }} \ - --tmp $(Agent.TempDirectory) \ - --azdev-pat '$(dn-bot-all-orgs-code-r)' \ - --ci \ + ./eng/common/vmr-sync.sh \ + --vmr ${{ parameters.vmrPath }} \ + --tmp $(Agent.TempDirectory) \ + --azdev-pat '$(AzdoToken)' \ + --ci \ --debug if [ "$?" -ne 0 ]; then @@ -67,11 +67,11 @@ steps: condition: eq(variables['Agent.OS'], 'Windows_NT') - powershell: | - ./eng/common/vmr-sync.ps1 ` - -vmr ${{ parameters.vmrPath }} ` - -tmp $(Agent.TempDirectory) ` - -azdevPat '$(dn-bot-all-orgs-code-r)' ` - -ci ` + ./eng/common/vmr-sync.ps1 ` + -vmr ${{ parameters.vmrPath }} ` + -tmp $(Agent.TempDirectory) ` + -azdevPat '$(AzdoToken)' ` + -ci ` -debugOutput if ($LASTEXITCODE -ne 0) { diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 65adefc7f26871..fc72fe63049d99 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -13,12 +13,6 @@ # Set to true to output binary log from msbuild. Note that emitting binary log slows down the build. [bool]$binaryLog = if (Test-Path variable:binaryLog) { $binaryLog } else { $ci -and !$excludeCIBinarylog } -# Set to true to use the pipelines logger which will enable Azure logging output. -# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md -# This flag is meant as a temporary opt-opt for the feature while validate it across -# our consumers. It will be deleted in the future. -[bool]$pipelinesLog = if (Test-Path variable:pipelinesLog) { $pipelinesLog } else { $ci } - # Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes). [bool]$prepareMachine = if (Test-Path variable:prepareMachine) { $prepareMachine } else { $false } @@ -596,16 +590,16 @@ function GetDefaultMSBuildEngine() { ExitWithExitCode 1 } -function GetNuGetPackageCachePath() { +function InitializeNuGetPackageCachePath() { if ($env:NUGET_PACKAGES -eq $null) { # Use local cache on CI to ensure deterministic build. - # Avoid using the http cache as workaround for https://github.com/NuGet/Home/issues/3116 # use global cache in dev builds to avoid cost of downloading packages. # For directory normalization, see also: https://github.com/NuGet/Home/issues/7968 if ($useGlobalNuGetCache) { - $env:NUGET_PACKAGES = Join-Path $env:UserProfile '.nuget\packages\' + $userProfile = if (IsWindowsPlatform) { $env:UserProfile } else { $env:HOME } + $env:NUGET_PACKAGES = [IO.Path]::Combine($userProfile, '.nuget', 'packages') + [IO.Path]::DirectorySeparatorChar } else { - $env:NUGET_PACKAGES = Join-Path $RepoRoot '.packages\' + $env:NUGET_PACKAGES = [IO.Path]::Combine($RepoRoot, '.packages') + [IO.Path]::DirectorySeparatorChar } } @@ -619,11 +613,7 @@ function GetSdkTaskProject([string]$taskName) { if (Test-Path $proj) { return $proj } - # TODO: Remove this fallback once all supported versions use the new layout. - $legacyProj = Join-Path $toolsetDir "SdkTasks\$taskName.proj" - if (Test-Path $legacyProj) { - return $legacyProj - } + throw "Unable to find $taskName.proj in toolset at: $toolsetDir" } @@ -658,8 +648,6 @@ function InitializeToolset() { return $global:_InitializeToolset } - $nugetCache = GetNuGetPackageCachePath - $toolsetVersion = Read-ArcadeSdkVersion $toolsetToolsDir = Join-Path $ToolsetDir $toolsetVersion @@ -680,7 +668,7 @@ function InitializeToolset() { ExitWithExitCode 1 } - $downloadArgs = @("package", "download", "Microsoft.DotNet.Arcade.Sdk@$toolsetVersion", "--verbosity", "minimal", "--prerelease", "--output", "$nugetCache") + $downloadArgs = @("package", "download", "Microsoft.DotNet.Arcade.Sdk@$toolsetVersion", "--verbosity", "minimal", "--prerelease", "--output", "$nugetPackageCachePath") $nugetConfig = $env:NUGET_CONFIG if (-not $nugetConfig) { # Search for any variation of nuget.config in the RepoRoot @@ -697,25 +685,16 @@ function InitializeToolset() { } DotNet @downloadArgs - $packageDir = Join-Path $nugetCache (Join-Path 'microsoft.dotnet.arcade.sdk' $toolsetVersion) + $packageDir = Join-Path $nugetPackageCachePath (Join-Path 'microsoft.dotnet.arcade.sdk' $toolsetVersion) $packageToolsetDir = Join-Path $packageDir 'toolset' - $packageToolsDir = Join-Path $packageDir 'tools' - # TODO: Remove the tools/ check once all supported versions have the toolset folder. - if (!(Test-Path $packageToolsetDir) -and !(Test-Path $packageToolsDir)) { + if (!(Test-Path $packageToolsetDir)) { Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Arcade SDK package does not contain a toolset or tools folder: $packageDir" ExitWithExitCode 3 } New-Item -ItemType Directory -Path $toolsetToolsDir -Force | Out-Null - - # Copy toolset if present at the package root (new layout), otherwise fall back to tools - if (Test-Path $packageToolsetDir) { - Copy-Item -Path "$packageToolsetDir\*" -Destination $toolsetToolsDir -Recurse -Force - } else { - # TODO: Remove this fallback once all supported versions have the toolset folder. - Copy-Item -Path "$packageToolsDir\*" -Destination $toolsetToolsDir -Recurse -Force - } + Copy-Item -Path "$packageToolsetDir\*" -Destination $toolsetToolsDir -Recurse -Force if (Test-Path $buildProjPath) { $toolsetBuildProj = $buildProjPath @@ -757,73 +736,6 @@ function Stop-Processes() { # Terminates the script if the build fails. # function MSBuild() { - if ($pipelinesLog) { - $buildTool = InitializeBuildTool - - if ($ci -and $buildTool.Tool -eq 'dotnet') { - $env:NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS = 20 - $env:NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS = 20 - Write-PipelineSetVariable -Name 'NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS' -Value '20' - Write-PipelineSetVariable -Name 'NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS' -Value '20' - } - - Enable-Nuget-EnhancedRetry - - $toolsetBuildProject = InitializeToolset - $basePath = Split-Path -parent $toolsetBuildProject - $selectedPath = Join-Path $basePath (Join-Path $buildTool.Framework 'Microsoft.DotNet.ArcadeLogging.dll') - - if (-not $selectedPath) { - Write-PipelineTelemetryError -Category 'Build' -Message "Unable to find arcade sdk logger assembly: $selectedPath" - ExitWithExitCode 1 - } - - $args += "/logger:$selectedPath" - } - - MSBuild-Core @args -} - -# -# Executes a dotnet command with arguments passed to the function. -# Terminates the script if the command fails. -# -function DotNet() { - $dotnetRoot = InitializeDotNetCli -install:$restore - $dotnetPath = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet') - - $cmdArgs = "" - foreach ($arg in $args) { - if ($null -ne $arg -and $arg.Trim() -ne "") { - if ($arg.EndsWith('\')) { - $arg = $arg + "\" - } - $cmdArgs += " `"$arg`"" - } - } - - $env:ARCADE_BUILD_TOOL_COMMAND = "`"$dotnetPath`" $cmdArgs" - - $exitCode = Exec-Process $dotnetPath $cmdArgs - - if ($exitCode -ne 0) { - Write-Host "dotnet command failed with exit code $exitCode. Check errors above." -ForegroundColor Red - - if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$fromVMR) { - Write-PipelineSetResult -Result "Failed" -Message "dotnet command execution failed." - ExitWithExitCode 0 - } else { - ExitWithExitCode $exitCode - } - } -} - -# -# Executes msbuild (or 'dotnet msbuild') with arguments passed to the function. -# The arguments are automatically quoted. -# Terminates the script if the build fails. -# -function MSBuild-Core() { if ($ci) { if (!$binaryLog -and !$excludeCIBinarylog) { Write-PipelineTelemetryError -Category 'Build' -Message 'Binary log must be enabled in CI build, or explicitly opted-out from with the -excludeCIBinarylog switch.' @@ -836,8 +748,6 @@ function MSBuild-Core() { } } - Enable-Nuget-EnhancedRetry - $buildTool = InitializeBuildTool $cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci" @@ -895,6 +805,40 @@ function MSBuild-Core() { } } +# +# Executes a dotnet command with arguments passed to the function. +# Terminates the script if the command fails. +# +function DotNet() { + $dotnetRoot = InitializeDotNetCli -install:$restore + $dotnetPath = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet') + + $cmdArgs = "" + foreach ($arg in $args) { + if ($null -ne $arg -and $arg.Trim() -ne "") { + if ($arg.EndsWith('\')) { + $arg = $arg + "\" + } + $cmdArgs += " `"$arg`"" + } + } + + $env:ARCADE_BUILD_TOOL_COMMAND = "`"$dotnetPath`" $cmdArgs" + + $exitCode = Exec-Process $dotnetPath $cmdArgs + + if ($exitCode -ne 0) { + Write-Host "dotnet command failed with exit code $exitCode. Check errors above." -ForegroundColor Red + + if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$fromVMR) { + Write-PipelineSetResult -Result "Failed" -Message "dotnet command execution failed." + ExitWithExitCode 0 + } else { + ExitWithExitCode $exitCode + } + } +} + function GetMSBuildBinaryLogCommandLineArgument($arguments) { foreach ($argument in $arguments) { if ($argument -ne $null) { @@ -952,6 +896,12 @@ Create-Directory $ToolsetDir Create-Directory $TempDir Create-Directory $LogDir +# Direct MSBuild crash diagnostics (MSB4166 failure.txt files) to a known location +# under artifacts/log so they are captured as build artifacts in CI. +if (-not $env:MSBUILDDEBUGPATH) { + $env:MSBUILDDEBUGPATH = Join-Path $LogDir 'MsbuildDebugLogs' +} + Write-PipelineSetVariable -Name 'Artifacts' -Value $ArtifactsDir Write-PipelineSetVariable -Name 'Artifacts.Toolset' -Value $ToolsetDir Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir @@ -973,19 +923,5 @@ if (!$disableConfigureToolsetImport) { } } -# -# If $ci flag is set, turn on (and log that we did) special environment variables for improved Nuget client retry logic. -# -function Enable-Nuget-EnhancedRetry() { - if ($ci) { - Write-Host "Setting NUGET enhanced retry environment variables" - $env:NUGET_ENABLE_ENHANCED_HTTP_RETRY = 'true' - $env:NUGET_ENHANCED_MAX_NETWORK_TRY_COUNT = 6 - $env:NUGET_ENHANCED_NETWORK_RETRY_DELAY_MILLISECONDS = 1000 - $env:NUGET_RETRY_HTTP_429 = 'true' - Write-PipelineSetVariable -Name 'NUGET_ENABLE_ENHANCED_HTTP_RETRY' -Value 'true' - Write-PipelineSetVariable -Name 'NUGET_ENHANCED_MAX_NETWORK_TRY_COUNT' -Value '6' - Write-PipelineSetVariable -Name 'NUGET_ENHANCED_NETWORK_RETRY_DELAY_MILLISECONDS' -Value '1000' - Write-PipelineSetVariable -Name 'NUGET_RETRY_HTTP_429' -Value 'true' - } -} +# Initialize the nuget package cache vars +$nugetPackageCachePath = InitializeNuGetPackageCachePath diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 95c55ce9b4d914..48cab70ebf4b0b 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -8,16 +8,6 @@ ci=${ci:-false} # Build mode source_build=${source_build:-false} -# Set to true to use the pipelines logger which will enable Azure logging output. -# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md -# This flag is meant as a temporary opt-opt for the feature while validate it across -# our consumers. It will be deleted in the future. -if [[ "$ci" == true ]]; then - pipelines_log=${pipelines_log:-true} -else - pipelines_log=${pipelines_log:-false} -fi - # Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names. configuration=${configuration:-'Debug'} @@ -374,7 +364,7 @@ function InitializeBuildTool { _InitializeBuildToolCommand="msbuild" } -function GetNuGetPackageCachePath { +function InitializeNuGetPackageCachePath { if [[ -z ${NUGET_PACKAGES:-} ]]; then if [[ "$use_global_nuget_cache" == true ]]; then export NUGET_PACKAGES="$HOME/.nuget/packages/" @@ -384,7 +374,7 @@ function GetNuGetPackageCachePath { fi # return value - _GetNuGetPackageCachePath=$NUGET_PACKAGES + _InitializeNuGetPackageCachePath=$NUGET_PACKAGES } function InitializeNativeTools() { @@ -406,8 +396,6 @@ function InitializeToolset { return fi - GetNuGetPackageCachePath - ReadGlobalVersion "Microsoft.DotNet.Arcade.Sdk" local toolset_version=$_ReadGlobalVersion @@ -430,7 +418,7 @@ function InitializeToolset { ExitWithExitCode 2 fi - local download_args=("package" "download" "Microsoft.DotNet.Arcade.Sdk@$toolset_version" "--verbosity" "minimal" "--prerelease" "--output" "$_GetNuGetPackageCachePath") + local download_args=("package" "download" "Microsoft.DotNet.Arcade.Sdk@$toolset_version" "--verbosity" "minimal" "--prerelease" "--output" "$_InitializeNuGetPackageCachePath") local nuget_config="${NUGET_CONFIG:-}" if [[ -z "$nuget_config" ]]; then # Search for any variation of nuget.config in the RepoRoot @@ -447,23 +435,15 @@ function InitializeToolset { fi DotNet "${download_args[@]}" - local package_dir="$_GetNuGetPackageCachePath/microsoft.dotnet.arcade.sdk/$toolset_version" + local package_dir="$_InitializeNuGetPackageCachePath/microsoft.dotnet.arcade.sdk/$toolset_version" - # TODO: Remove the tools/ check once all supported versions have the toolset folder. - if [[ ! -d "$package_dir/toolset" && ! -d "$package_dir/tools" ]]; then - Write-PipelineTelemetryError -category 'InitializeToolset' "Arcade SDK package does not contain a toolset or tools folder: $package_dir" + if [[ ! -d "$package_dir/toolset" ]]; then + Write-PipelineTelemetryError -category 'InitializeToolset' "Arcade SDK package does not contain a toolset folder: $package_dir" ExitWithExitCode 3 fi mkdir -p "$toolset_tools_dir" - - # Copy toolset if present at the package root (new layout), otherwise fall back to tools - if [[ -d "$package_dir/toolset" ]]; then - cp -r "$package_dir/toolset/." "$toolset_tools_dir" - else - # TODO: Remove this fallback once all supported versions have the toolset folder. - cp -r "$package_dir/tools/." "$toolset_tools_dir" - fi + cp -r "$package_dir/toolset/." "$toolset_tools_dir" if [[ -a "$toolset_tools_dir/Build.proj" ]]; then toolset_build_proj="$toolset_tools_dir/Build.proj" @@ -511,33 +491,6 @@ function DotNet { } function MSBuild { - local args=( "$@" ) - if [[ "$pipelines_log" == true ]]; then - InitializeBuildTool - InitializeToolset - - if [[ "$ci" == true ]]; then - export NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS=20 - export NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS=20 - Write-PipelineSetVariable -name "NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS" -value "20" - Write-PipelineSetVariable -name "NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS" -value "20" - fi - - local toolset_dir="${_InitializeToolset%/*}" - local selectedPath="$toolset_dir/net/Microsoft.DotNet.ArcadeLogging.dll" - - if [[ -z "$selectedPath" ]]; then - Write-PipelineTelemetryError -category 'Build' "Unable to find arcade sdk logger assembly: $selectedPath" - ExitWithExitCode 1 - fi - - args+=( "-logger:$selectedPath" ) - fi - - MSBuild-Core "${args[@]}" -} - -function MSBuild-Core { if [[ "$ci" == true ]]; then if [[ "$binary_log" != true && "$exclude_ci_binary_log" != true ]]; then Write-PipelineTelemetryError -category 'Build' "Binary log must be enabled in CI build, or explicitly opted-out from with the -noBinaryLog switch." @@ -615,12 +568,7 @@ function GetSdkTaskProject { echo "$proj" return fi - # TODO: Remove this fallback once all supported versions use the new layout. - local legacyProj="$toolsetDir/SdkTasks/$taskName.proj" - if [[ -a "$legacyProj" ]]; then - echo "$legacyProj" - return - fi + Write-PipelineTelemetryError -category 'Build' "Unable to find $taskName.proj in toolset at: $toolsetDir" ExitWithExitCode 3 } @@ -660,6 +608,12 @@ mkdir -p "$toolset_dir" mkdir -p "$temp_dir" mkdir -p "$log_dir" +# Direct MSBuild crash diagnostics (MSB4166 failure.txt files) to a known location +# under artifacts/log so they are captured as build artifacts in CI. +if [[ -z "${MSBUILDDEBUGPATH:-}" ]]; then + export MSBUILDDEBUGPATH="$log_dir/MsbuildDebugLogs" +fi + Write-PipelineSetVariable -name "Artifacts" -value "$artifacts_dir" Write-PipelineSetVariable -name "Artifacts.Toolset" -value "$toolset_dir" Write-PipelineSetVariable -name "Artifacts.Log" -value "$log_dir" @@ -680,3 +634,6 @@ fi if [[ -n "${useInstalledDotNetCli:-}" ]]; then use_installed_dotnet_cli="$useInstalledDotNetCli" fi + +# Initialize the nuget package cache vars +InitializeNuGetPackageCachePath diff --git a/global.json b/global.json index 01f9d078a1fb65..8d47900ffba1b7 100644 --- a/global.json +++ b/global.json @@ -13,11 +13,11 @@ "dotnet": "11.0.100-preview.5.26227.104" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26257.113", - "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.26257.113", - "Microsoft.DotNet.SharedFramework.Sdk": "11.0.0-beta.26257.113", + "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26302.118", + "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.26302.118", + "Microsoft.DotNet.SharedFramework.Sdk": "11.0.0-beta.26302.118", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", - "Microsoft.NET.Sdk.IL": "11.0.0-preview.5.26257.113" + "Microsoft.NET.Sdk.IL": "11.0.0-preview.6.26302.118" } } From d5cdcc696fd012e8a08b8683c24183de153e83b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Wed, 27 May 2026 19:01:57 +0200 Subject: [PATCH 3/9] Remove STJ union tests for shapes the C# compiler now rejects Roslyn (dotnet/roslyn#83813) added two new hard errors for malformed [UnionAttribute] usage: CS9385: A union type must have at least one union creation member. CS9386: A union member provider type must have a public instance 'Value' property of type 'object?' or 'object'. Hard errors cannot be suppressed via #pragma warning disable, so the two C# test types that deliberately violated these rules no longer compile. Remove the now-uncompilable types and their associated tests, and drop the matching [JsonSerializable] entries from the source-gen contexts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/Common/UnionTests.cs | 64 ------------------- .../Serialization/UnionTests.cs | 4 -- 2 files changed, 68 deletions(-) diff --git a/src/libraries/System.Text.Json/tests/Common/UnionTests.cs b/src/libraries/System.Text.Json/tests/Common/UnionTests.cs index 3180f31ebff090..d5996eef7e1899 100644 --- a/src/libraries/System.Text.Json/tests/Common/UnionTests.cs +++ b/src/libraries/System.Text.Json/tests/Common/UnionTests.cs @@ -1211,70 +1211,6 @@ public void IUnion_Alone_DoesNotTriggerUnionBehavior() Assert.Equal(JsonTypeInfoKind.Object, typeInfo.Kind); } -#pragma warning disable SYSLIB1228 - [Union] - public class UserDefinedUnionWithoutValueProperty - { - public UserDefinedUnionWithoutValueProperty(int v) { X = v; } - public int X { get; } - } -#pragma warning restore SYSLIB1228 - - [Fact] - public void UnionAttribute_WithoutValueProperty_ThrowsAtConfigure() - { - InvalidOperationException ex = Assert.Throws( - () => Serializer.GetTypeInfo()); - - Assert.Contains(nameof(UserDefinedUnionWithoutValueProperty), ex.Message); - } - -#pragma warning disable SYSLIB1228 - [Union] - public class UserDefinedUnconventionalUnion - { - public UserDefinedUnconventionalUnion(int x, int y) { Sum = x + y; } - public int Sum { get; } - public object Value => Sum; - } -#pragma warning restore SYSLIB1228 - - [Fact] - public void UnionMissingMetadata_DefaultResolver_ThrowsAtConfigure() - { - InvalidOperationException ex = Assert.Throws( - () => Serializer.GetTypeInfo()); - - Assert.Contains(nameof(UserDefinedUnconventionalUnion), ex.Message); - } - - [Fact] - public async Task UnionMissingMetadata_ContractCustomization_RescuesAndRoundTrips() - { - // The convention path produces an empty union JsonTypeInfo. A modifier patches it up by - // providing UnionCases plus the deconstructor/constructor delegates. - JsonSerializerOptions options = Serializer.GetDefaultOptionsWithMetadataModifier(typeInfo => - { - if (typeInfo.Type != typeof(UserDefinedUnconventionalUnion)) - { - return; - } - - JsonTypeInfo ti = (JsonTypeInfo)typeInfo; - ti.UnionCases.Add(new JsonUnionCaseInfo(typeof(int))); - ti.UnionDeconstructor = static (UserDefinedUnconventionalUnion u) => (typeof(int), (object?)u.Sum); - ti.UnionConstructor = static (Type _, object? value) => new UserDefinedUnconventionalUnion((int)value!, 0); - }); - - UserDefinedUnconventionalUnion value = new(2, 3); - string json = await Serializer.SerializeWrapper(value, options); - Assert.Equal("5", json); - - UserDefinedUnconventionalUnion? roundTripped = await Serializer.DeserializeWrapper("7", options); - Assert.NotNull(roundTripped); - Assert.Equal(7, roundTripped!.Sum); - } - [Union] public class UserDefinedAttributeOnlyUnion { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/UnionTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/UnionTests.cs index 0760551cc2b368..e21e183e962425 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/UnionTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/UnionTests.cs @@ -42,8 +42,6 @@ public UnionTests_Metadata() [JsonSerializable(typeof(UserDefinedAttributeOnlyUnion))] [JsonSerializable(typeof(UserDefinedNullableAttributeOnlyUnion))] [JsonSerializable(typeof(UserDefinedCtorVsImplicitOpUnion))] - [JsonSerializable(typeof(UserDefinedUnconventionalUnion))] - [JsonSerializable(typeof(UserDefinedUnionWithoutValueProperty))] [JsonSerializable(typeof(UserDefinedJsonUnionOnPlainObject))] [JsonSerializable(typeof(UserDefinedUnionViaIUnion))] [JsonSerializable(typeof(UserDefinedValueTypeUnion))] @@ -103,8 +101,6 @@ public UnionTests_Default() [JsonSerializable(typeof(UserDefinedAttributeOnlyUnion))] [JsonSerializable(typeof(UserDefinedNullableAttributeOnlyUnion))] [JsonSerializable(typeof(UserDefinedCtorVsImplicitOpUnion))] - [JsonSerializable(typeof(UserDefinedUnconventionalUnion))] - [JsonSerializable(typeof(UserDefinedUnionWithoutValueProperty))] [JsonSerializable(typeof(UserDefinedJsonUnionOnPlainObject))] [JsonSerializable(typeof(UserDefinedUnionViaIUnion))] [JsonSerializable(typeof(UserDefinedValueTypeUnion))] From 5aa53a2531ca012cf95c3f47079f3fa7db57811d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 22 May 2026 12:46:42 +0200 Subject: [PATCH 4/9] Fix remaining xUnit1056 errors across runtime tests Ensure test classes have a single public parameterless constructor as required by xUnit1056. For classes with only private/internal constructors, add a public parameterless constructor. For structs with explicit constructors (GitHub_19537 Matrix4x4), move [Fact] to a separate wrapper class. For ContextualReflection.Program which had two public constructors, make the non-default one internal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit c572809a3a5ead3c5eee2943a819d6117252b92e) --- src/tests/JIT/CodeGenBringUpTests/Rotate.cs | 2 ++ .../interlocked/IntrinsicTest_Overflow.cs | 2 +- .../CLR-x86-JIT/V1-M09/b13621/b13621.cs | 2 ++ .../CLR-x86-JIT/V1-M12-Beta2/b59297/b59297.cs | 2 +- .../JitBlue/GitHub_10940/GitHub_10940.cs | 2 ++ .../JitBlue/GitHub_18887/GitHub_18887.cs | 2 +- .../JitBlue/GitHub_19537/GitHub_19537.cs | 15 +++++++++++---- .../JitBlue/GitHub_22556/GitHub_22556.cs | 2 ++ .../JitBlue/GitHub_27923/GitHub_27923.cs | 2 +- src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs | 2 ++ .../ContextualReflection/ContextualReflection.cs | 2 +- .../CircularCctorTwoThreadsThreeCC.cs | 2 ++ .../Regressions/coreclr/GitHub_17398/test17398.cs | 2 ++ .../dynamicobjectproperties/test448035.cs | 2 ++ .../exceptions/regressions/V1/SEH/COOL/rethrow.cs | 2 ++ .../regressions/V1/SEH/VJ/HandlerException.cs | 2 ++ .../regressions/V1/SEH/VJ/MultipleException.cs | 2 ++ .../regressions/V1/SEH/VJ/NestedException.cs | 2 ++ 18 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/tests/JIT/CodeGenBringUpTests/Rotate.cs b/src/tests/JIT/CodeGenBringUpTests/Rotate.cs index efde861d46af4d..cdf0a6298e69a9 100644 --- a/src/tests/JIT/CodeGenBringUpTests/Rotate.cs +++ b/src/tests/JIT/CodeGenBringUpTests/Rotate.cs @@ -227,6 +227,8 @@ uint rol32ushort(int amount) return ((uint)usfield << amount) | ((uint)usfield >> (32 - amount)); } + public Test_Rotate() { } + Test_Rotate(ulong i, uint j, ushort k) { field = i; diff --git a/src/tests/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs b/src/tests/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs index f193693bf6475b..6f0351438e3797 100644 --- a/src/tests/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs +++ b/src/tests/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs @@ -24,7 +24,7 @@ public class IntrinsicTest private static long s_idjunk = 0; [MethodImpl(MethodImplOptions.NoInlining)] - private IntrinsicTest() { _instanceCounter = 3245; _instanceCounter64 = 3245; _id_instanceCounter = 3245; _id_instanceCounter64 = 3245; } + public IntrinsicTest() { _instanceCounter = 3245; _instanceCounter64 = 3245; _id_instanceCounter = 3245; _id_instanceCounter64 = 3245; } public int GetValue() { s_temp++; return (int)0x1ceddeed; } [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09/b13621/b13621.cs b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09/b13621/b13621.cs index d52c0f3a731b26..02f3e22fadd499 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09/b13621/b13621.cs +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09/b13621/b13621.cs @@ -32,6 +32,8 @@ public static void TestEntryPoint() } } + public RootMem() { } + private RootMem(int i) { if (i > 0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59297/b59297.cs b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59297/b59297.cs index b0f483e8c7117b..7000acfae2ed0c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59297/b59297.cs +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59297/b59297.cs @@ -17,7 +17,7 @@ public class PerfNotIf bool m_i; - PerfNotIf() + public PerfNotIf() { m_i = true; /* JVM diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.cs b/src/tests/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.cs index 39b79edf5464e7..9a6d6eea0ac6a9 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.cs @@ -43,6 +43,8 @@ public override int GetReturnValue() } } + public Test_GitHub_10940() { } + Test_GitHub_10940(string s, decimal d) { } diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_18887/GitHub_18887.cs b/src/tests/JIT/Regression/JitBlue/GitHub_18887/GitHub_18887.cs index 8ff0078bd7d60f..a7822b0f9d93fe 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_18887/GitHub_18887.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_18887/GitHub_18887.cs @@ -54,7 +54,7 @@ public class Program bool forceUpload; BufferState currentState; - Program() + public Program() { this.forceUpload = false; this.currentState = new BufferState(); diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_19537/GitHub_19537.cs b/src/tests/JIT/Regression/JitBlue/GitHub_19537/GitHub_19537.cs index 7dd1e3f2f217e9..26967070bacdc8 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_19537/GitHub_19537.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_19537/GitHub_19537.cs @@ -384,9 +384,7 @@ public override string ToString() M41, M42, M43, M44); } - [OuterLoop] - [Fact] - public static int TestEntryPoint() + public static int Run() { Matrix4x4 m1 = new Matrix4x4(1.0F,2.0F,3.0F,4.0F, 5.0F,6.0F,7.0F,8.0F, @@ -418,5 +416,14 @@ public static int TestEntryPoint() } } -} + public class GitHub_19537_Test + { + [OuterLoop] + [Fact] + public static int TestEntryPoint() + { + return Matrix4x4.Run(); + } + } +} diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_22556/GitHub_22556.cs b/src/tests/JIT/Regression/JitBlue/GitHub_22556/GitHub_22556.cs index 88af3e419574da..0b63db49902897 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_22556/GitHub_22556.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_22556/GitHub_22556.cs @@ -13,6 +13,8 @@ public class Test_GitHub_22556 { int f; + public Test_GitHub_22556() { } + Test_GitHub_22556(int f) { this.f = f; diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_27923/GitHub_27923.cs b/src/tests/JIT/Regression/JitBlue/GitHub_27923/GitHub_27923.cs index 895ca5ced0b305..87900a919a8b65 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_27923/GitHub_27923.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_27923/GitHub_27923.cs @@ -14,7 +14,7 @@ public class Writer public int Position { get; set; } [MethodImpl(MethodImplOptions.NoInlining)] - Writer() + public Writer() { Data = new int[] { 100, -1, -2, -3 }; Position = 4; diff --git a/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs b/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs index e8433f5822c628..33d7a335bd680e 100644 --- a/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs +++ b/src/tests/JIT/opt/Inline/tests/Inline_NewObj.cs @@ -9,6 +9,8 @@ public class MainApp_Inline { private int _v; + public MainApp_Inline() { } + private MainApp_Inline(int i) { switch (i) diff --git a/src/tests/Loader/ContextualReflection/ContextualReflection.cs b/src/tests/Loader/ContextualReflection/ContextualReflection.cs index 616606283f94ba..394309165bad18 100644 --- a/src/tests/Loader/ContextualReflection/ContextualReflection.cs +++ b/src/tests/Loader/ContextualReflection/ContextualReflection.cs @@ -49,7 +49,7 @@ public Program() InitializeIsolation(true); } - public Program(bool isolated) + internal Program(bool isolated) { InitializeIsolation(isolated); } diff --git a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs index 3b3081c910ad4d..b0bd9ef51579ac 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs +++ b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs @@ -86,6 +86,8 @@ public static Coordinator CreateThread(bool xThenY, SlotConstants threadTag) public readonly Thread Thread; private static readonly Barrier s_barrier = new (3); + public Coordinator() { } + private Coordinator(bool xThenY, SlotConstants threadTag) { var t = new Thread(() => { diff --git a/src/tests/Regressions/coreclr/GitHub_17398/test17398.cs b/src/tests/Regressions/coreclr/GitHub_17398/test17398.cs index b4c777d354daf0..715c5127b71298 100644 --- a/src/tests/Regressions/coreclr/GitHub_17398/test17398.cs +++ b/src/tests/Regressions/coreclr/GitHub_17398/test17398.cs @@ -16,6 +16,8 @@ public class X public override string ToString() => s; + public X() { } + [MethodImpl(MethodImplOptions.NoInlining)] X(int x) { diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs b/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs index ce8d837cb23248..674c6e7a54bc8d 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs @@ -8,6 +8,8 @@ public class Test_test448035 { int countdown; + public Test_test448035() { } + Test_test448035(int n) { countdown = n; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs index 9a07cf1fb86e3c..fa0741f73b38cc 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs @@ -54,6 +54,8 @@ public UserException4(int id) : base(id) public class RethrowException { private int ThreadId; + public RethrowException() { } + private RethrowException(int id){ ThreadId = id; } diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs index bc7a917f69b4c7..6242f7139a88e8 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs @@ -41,6 +41,8 @@ public UserException4(int id){ public class HandlerException { private int ThreadId; + public HandlerException() { } + private HandlerException(int id){ ThreadId = id; } diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs index c7112b85949446..e7a3bfc9fd446c 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs @@ -16,6 +16,8 @@ public UserException(int id){ public class MultipleException { private int ThreadId; + public MultipleException() { } + private MultipleException(int id){ ThreadId = id; } diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs index 3f0af2599433ac..b7d4904c3650b6 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs @@ -41,6 +41,8 @@ public UserException4(int id){ public class NestedException { private int ThreadId; + public NestedException() { } + private NestedException(int id){ ThreadId = id; } From 7bb90f08c925214c2d515f0ef6a5d33c68f0561b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 22 May 2026 10:53:41 +0200 Subject: [PATCH 5/9] Fix xUnit1056 errors in JIT test classes For classes with only private constructors (instance.cs, gcreport.cs, twoEndFinallys.cs, pidigits-3.cs, arrres.cs): ensure a public parameterless constructor exists so xUnit can instantiate the test class. For structs with multiple public constructors (ctor_recurse.cs, han3_ctor.cs, han3_ref.cs): move [Fact] methods to separate wrapper classes since structs inherently have an implicit parameterless constructor plus any explicit ones, causing ambiguity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit fbb7a0739d2edd2a245bcecb8edb8bbea8aaafad) --- src/tests/JIT/Methodical/Arrays/misc/arrres.cs | 2 ++ .../JIT/Methodical/Boxing/callconv/instance.cs | 2 ++ src/tests/JIT/Methodical/VT/etc/ctor_recurse.cs | 14 +++++++++++--- src/tests/JIT/Methodical/VT/etc/han3_ctor.cs | 14 +++++++++++--- src/tests/JIT/Methodical/VT/etc/han3_ref.cs | 14 +++++++++++--- .../flowgraph/bug619534/twoEndFinallys.cs | 2 +- src/tests/JIT/Methodical/refany/gcreport.cs | 2 +- .../BenchmarksGame/pidigits/pidigits-3.cs | 2 ++ 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/tests/JIT/Methodical/Arrays/misc/arrres.cs b/src/tests/JIT/Methodical/Arrays/misc/arrres.cs index f453c0ee4672cd..1b48f1ebdf224a 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/arrres.cs +++ b/src/tests/JIT/Methodical/Arrays/misc/arrres.cs @@ -13,6 +13,8 @@ public class Test public bool m_die; private static Test[] s_arr = new Test[50]; + public Test() { } + private Test(int indx) { _indx = indx; } internal virtual void CheckValid() diff --git a/src/tests/JIT/Methodical/Boxing/callconv/instance.cs b/src/tests/JIT/Methodical/Boxing/callconv/instance.cs index 0c70cc18945bc0..7eeab34d001d96 100644 --- a/src/tests/JIT/Methodical/Boxing/callconv/instance.cs +++ b/src/tests/JIT/Methodical/Boxing/callconv/instance.cs @@ -38,6 +38,8 @@ protected override object Fibonacci2(object num, object flag) return N; } + public Test() { } + private Test(object num) { _num = (float)(double)num; diff --git a/src/tests/JIT/Methodical/VT/etc/ctor_recurse.cs b/src/tests/JIT/Methodical/VT/etc/ctor_recurse.cs index 9c7e2bb59bb727..9f847fe48dcca0 100644 --- a/src/tests/JIT/Methodical/VT/etc/ctor_recurse.cs +++ b/src/tests/JIT/Methodical/VT/etc/ctor_recurse.cs @@ -22,9 +22,7 @@ public struct T private void DoMethod() { } - [Fact] - [OuterLoop] - public static void TestEntryPoint() + public static void Run() { s_stat = new T(new S(new T(new S(new T(new S(new T(new S(new T(new S( @@ -43,4 +41,14 @@ public static void TestEntryPoint() ; } } + + public class CtorRecurseTest + { + [Fact] + [OuterLoop] + public static void TestEntryPoint() + { + T.Run(); + } + } } diff --git a/src/tests/JIT/Methodical/VT/etc/han3_ctor.cs b/src/tests/JIT/Methodical/VT/etc/han3_ctor.cs index 872964542e23f1..2aa275ce60988a 100644 --- a/src/tests/JIT/Methodical/VT/etc/han3_ctor.cs +++ b/src/tests/JIT/Methodical/VT/etc/han3_ctor.cs @@ -69,9 +69,7 @@ private static int move(Column from, Column to, Column temp, int num) return C; } - [Fact] - [OuterLoop] - public static int TestEntryPoint() + public static int Run() { return move(new Column(17, 17), new Column(17, 0), @@ -79,4 +77,14 @@ public static int TestEntryPoint() 17) - 130971; } } + + public class Han3CtorTest + { + [Fact] + [OuterLoop] + public static int TestEntryPoint() + { + return Column.Run(); + } + } } diff --git a/src/tests/JIT/Methodical/VT/etc/han3_ref.cs b/src/tests/JIT/Methodical/VT/etc/han3_ref.cs index cdee3fdd4f5dab..6f85c4f7359e5a 100644 --- a/src/tests/JIT/Methodical/VT/etc/han3_ref.cs +++ b/src/tests/JIT/Methodical/VT/etc/han3_ref.cs @@ -69,9 +69,7 @@ private static int move(ref Column from, ref Column to, ref Column temp, int num return C; } - [Fact] - [OuterLoop] - public static int TestEntryPoint() + public static int Run() { Column c1 = new Column(17, 17); Column c2 = new Column(17, 0); @@ -83,4 +81,14 @@ public static int TestEntryPoint() return ec; } } + + public class Han3RefTest + { + [Fact] + [OuterLoop] + public static int TestEntryPoint() + { + return Column.Run(); + } + } } diff --git a/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.cs b/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.cs index 06c6a7e28ef0af..2a3d1c55e0e022 100644 --- a/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.cs +++ b/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.cs @@ -26,7 +26,7 @@ public class Test private int _temp; private static int s_result = 100; - private Test() + public Test() { _temp = 101; } diff --git a/src/tests/JIT/Methodical/refany/gcreport.cs b/src/tests/JIT/Methodical/refany/gcreport.cs index 4d9c814462bc21..c5f6715c5eb573 100644 --- a/src/tests/JIT/Methodical/refany/gcreport.cs +++ b/src/tests/JIT/Methodical/refany/gcreport.cs @@ -17,7 +17,7 @@ public class StressTest { private StressTest2 _m_internal; - private StressTest() + public StressTest() { _m_internal = new StressTest2(); _m_internal.m_parent = this; diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pidigits-3.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pidigits-3.cs index 9d72d90b222cbe..be7d90d1c52888 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pidigits-3.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/pidigits/pidigits-3.cs @@ -35,6 +35,8 @@ public class pidigits StringBuilder strBuf = new StringBuilder(40), lastBuf = null; int n; + public pidigits() { } + pidigits(int n) { this.n = n; From d2b7c3b241529cb7112ec8c2dae9052f2f58809f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 21 May 2026 16:36:34 +0200 Subject: [PATCH 6/9] Fix xUnit1056 analyzer errors in runtime test classes Ensure each test class has exactly one public non-static constructor as required by the xUnit1056 rule: - CollectionCountTest: make parameterless constructor public - ClosedStatic: add public parameterless constructor (keep private parameterized one to avoid xUnit1041) - NDPin: add public parameterless constructor (keep internal parameterized one to avoid xUnit1041) - RootMem: add public parameterless constructor (keep private parameterized one to avoid xUnit1041) - ReflectObj: make ReflectObj(int) constructor internal (was two public constructors), update Activator.CreateInstance call to use BindingFlags and DynamicallyAccessedMembers annotation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 2f895947c160063d40ce0a5db70f97a2b37d11c5) --- .../system/delegate/miscellaneous/ClosedStatic.cs | 2 ++ src/tests/GC/API/GC/CollectionCountTest.cs | 2 +- src/tests/GC/Scenarios/NDPin/ndpin.cs | 2 ++ src/tests/GC/Scenarios/ReflectObj/reflectobj.cs | 6 +++--- src/tests/GC/Scenarios/Rootmem/rootmem.cs | 2 ++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tests/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs b/src/tests/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs index ac65593a9648b3..4a989029468696 100644 --- a/src/tests/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs +++ b/src/tests/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs @@ -8,6 +8,8 @@ public class ClosedStatic { public int scale; + public ClosedStatic() { } + private ClosedStatic(int scale) { this.scale = scale; diff --git a/src/tests/GC/API/GC/CollectionCountTest.cs b/src/tests/GC/API/GC/CollectionCountTest.cs index 8dba9df5b97be7..840aa8f18da06c 100644 --- a/src/tests/GC/API/GC/CollectionCountTest.cs +++ b/src/tests/GC/API/GC/CollectionCountTest.cs @@ -22,7 +22,7 @@ public class CollectionCountTest private Int32[] _negValues = { -1, -10, -10000, Int32.MinValue }; private Int32[] _largeValues = { GC.MaxGeneration + 1, Int32.MaxValue / 2, Int32.MaxValue - 1, Int32.MaxValue }; - private CollectionCountTest() + public CollectionCountTest() { } diff --git a/src/tests/GC/Scenarios/NDPin/ndpin.cs b/src/tests/GC/Scenarios/NDPin/ndpin.cs index a9a9a0a7e01b8c..193069366405ef 100644 --- a/src/tests/GC/Scenarios/NDPin/ndpin.cs +++ b/src/tests/GC/Scenarios/NDPin/ndpin.cs @@ -13,6 +13,8 @@ public class NDPin internal static NDPin m_n; internal static Object m_o; + public NDPin () { } + internal NDPin (Object p) { this.p = p; diff --git a/src/tests/GC/Scenarios/ReflectObj/reflectobj.cs b/src/tests/GC/Scenarios/ReflectObj/reflectobj.cs index 930f10093b216a..186cf81f5fd62c 100644 --- a/src/tests/GC/Scenarios/ReflectObj/reflectobj.cs +++ b/src/tests/GC/Scenarios/ReflectObj/reflectobj.cs @@ -34,7 +34,7 @@ public ReflectObj() icCreat++; } - public ReflectObj( int l ) + internal ReflectObj( int l ) { obj = new long[l]; icCreat++; @@ -69,7 +69,7 @@ public static int TestEntryPoint() class CreateObj { private Object[] v; - [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] private Type myClass; private Type [] rtype; private ConstructorInfo CInfo; @@ -81,7 +81,7 @@ public CreateObj() for( int i=0; i< 2000; i++ ) { v[0] = i; - Activator.CreateInstance(myClass, v ); + Activator.CreateInstance(myClass, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, v, null); } } diff --git a/src/tests/GC/Scenarios/Rootmem/rootmem.cs b/src/tests/GC/Scenarios/Rootmem/rootmem.cs index 993674f74697ec..98cb93dbd3ab63 100644 --- a/src/tests/GC/Scenarios/Rootmem/rootmem.cs +++ b/src/tests/GC/Scenarios/Rootmem/rootmem.cs @@ -82,6 +82,8 @@ public static int TestEntryPoint() return 1; } + public RootMem() { } + private RootMem( int i ) { if( i> 0) From c32937d720bc25e4cdde868ecb93bcf650a5a1e3 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 18 May 2026 12:14:41 -0700 Subject: [PATCH 7/9] Use MicrosoftTestingPlatformVersion for CrashDump/HangDump testing extensions (cherry picked from commit 48f9d872f2cddeb9cdf6834fe51cf83b653f81eb) --- src/installer/tests/Directory.Build.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/installer/tests/Directory.Build.targets b/src/installer/tests/Directory.Build.targets index e4218ebb7b53f4..a0e57f66aac71d 100644 --- a/src/installer/tests/Directory.Build.targets +++ b/src/installer/tests/Directory.Build.targets @@ -93,8 +93,8 @@ - - + + Date: Fri, 15 May 2026 18:47:57 +0200 Subject: [PATCH 8/9] Remove ambiguous int[] overloads causing xUnit1065 errors Remove Ranges(int[]) and BinaryRanges(int[], int[]) overloads from Sources and UnorderedSources that were simple wrappers delegating to their IEnumerable counterparts. Since int[] implements IEnumerable, xUnit MemberData could not disambiguate between the two, producing xUnit1065 analyzer errors. The IEnumerable overloads handle int[] arguments directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 11dc266b13c67c0ddf653f0dc20fcc74abec817e) --- .../tests/Helpers/Sources.cs | 5 --- .../tests/Helpers/UnorderedSources.cs | 41 ------------------- 2 files changed, 46 deletions(-) diff --git a/src/libraries/System.Linq.Parallel/tests/Helpers/Sources.cs b/src/libraries/System.Linq.Parallel/tests/Helpers/Sources.cs index a059a0eedd4f48..8dcf69c3b56ccd 100644 --- a/src/libraries/System.Linq.Parallel/tests/Helpers/Sources.cs +++ b/src/libraries/System.Linq.Parallel/tests/Helpers/Sources.cs @@ -27,11 +27,6 @@ public static IEnumerable OuterLoopRanges() foreach (object[] parms in Ranges(OuterLoopCounts)) yield return parms; } - public static IEnumerable Ranges(int[] counts) - { - foreach (object[] parms in Ranges(counts.Cast())) yield return parms; - } - public static IEnumerable Ranges(IEnumerable counts) { foreach (object[] parms in Ranges(0, counts)) yield return parms; diff --git a/src/libraries/System.Linq.Parallel/tests/Helpers/UnorderedSources.cs b/src/libraries/System.Linq.Parallel/tests/Helpers/UnorderedSources.cs index 3b7da85ee9abf4..2c220acd6f6274 100644 --- a/src/libraries/System.Linq.Parallel/tests/Helpers/UnorderedSources.cs +++ b/src/libraries/System.Linq.Parallel/tests/Helpers/UnorderedSources.cs @@ -72,19 +72,6 @@ public static IEnumerable Ranges(int start, IEnumerable counts) foreach (object[] parms in Ranges(x => start, counts)) yield return parms; } - /// - /// Get a set of ranges, starting at 0, and running for each count in `counts`. - /// - /// This version is a wrapper for use from the MemberData attribute. - /// The sizes of ranges to return. - /// Entries for test data. - /// The first element is the Labeled{ParallelQuery{int}} range, - /// and the second element is the count - public static IEnumerable Ranges(int[] counts) - { - foreach (object[] parms in Ranges(counts.Cast())) yield return parms; - } - /// /// Get a set of ranges, starting at 0, and having OuterLoopCount elements. /// @@ -96,34 +83,6 @@ public static IEnumerable OuterLoopRanges() foreach (object[] parms in Ranges(new[] { Sources.OuterLoopCount })) yield return parms; } - /// - /// Get a set of ranges, starting at `start`, and running for each count in `counts`. - /// - /// This version is a wrapper for use from the MemberData attribute. - /// The starting element of the range. - /// The sizes of ranges to return. - /// Entries for test data. - /// The first element is the Labeled{ParallelQuery{int}} range, - /// the second element is the count, and the third is the start. - public static IEnumerable Ranges(int start, int[] counts) - { - foreach (object[] parms in Ranges(start, counts.Cast())) yield return parms; - } - - /// - /// Return pairs of ranges, both from 0 to each respective count in `counts`. - /// - /// This version is a wrapper for use from the MemberData attribute. - /// The sizes of left ranges to return. - /// The sizes of right ranges to return. - /// Entries for test data. - /// The first element is the left Labeled{ParallelQuery{int}} range, the second element is the left count, - /// the third element is the right Labeled{ParallelQuery{int}} range, and the fourth element is the right count, . - public static IEnumerable BinaryRanges(int[] leftCounts, int[] rightCounts) - { - foreach (object[] parms in BinaryRanges(leftCounts.Cast(), rightCounts.Cast())) yield return parms; - } - /// /// Get a set of ranges, starting at 0, and running for each count in `counts`. /// From 14fbc7cfe01c7ff3b4c4b0d1159941bc678bdf2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 4 Jun 2026 11:19:40 +0200 Subject: [PATCH 9/9] Add timeout for counterLoaded TCS in BlazorApp_BasedOnFingerprinting_LoadsWasmAssetsFromCache to prevent hang --- src/mono/wasm/Wasm.Build.Tests/Blazor/AssetCachingTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/AssetCachingTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/AssetCachingTests.cs index d0ad41c00462a1..1ab518337939db 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/AssetCachingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/AssetCachingTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -45,7 +46,7 @@ public async Task BlazorApp_BasedOnFingerprinting_LoadsWasmAssetsFromCache() var baseUrl = page.Url; await page.GotoAsync($"{baseUrl}counter"); - await counterLoaded.Task; + await counterLoaded.Task.WaitAsync(TimeSpan.FromSeconds(30)); using var requestLogClient = new BlazorWebWasmLogClient(baseUrl); var firstLoadRequestLogs = await requestLogClient.GetRequestLogsAsync(); @@ -60,7 +61,7 @@ public async Task BlazorApp_BasedOnFingerprinting_LoadsWasmAssetsFromCache() // Perform browser navigation to cause resource reload. await page.ReloadAsync(); - await counterLoaded.Task; + await counterLoaded.Task.WaitAsync(TimeSpan.FromSeconds(30)); var secondLoadRequestLogs = await requestLogClient.GetRequestLogsAsync(); var secondLoadWasmRequests = secondLoadRequestLogs.Where(log => log.Path.EndsWith(".wasm"));