From 00317695b5ee4016ff438fce6335e2a86db360f0 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 17 Oct 2025 02:04:01 +0000 Subject: [PATCH 1/2] Backflow from https://github.com/dotnet/dotnet / 79c85d9 build 287426 [[ commit created by automation ]] --- eng/Versions.props | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 8cf7ccacbfcd4e..9b87a0761e35e1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -147,7 +147,7 @@ 10.2.0 17.0.46 - 10.0.0-preview-20250912.1 + 10.0.0-preview-20251006.1 2.4.15 9.0.0-alpha.1.24167.3 @@ -169,11 +169,11 @@ 3.1.56 - 5.0.2-dotnet.2737382 - 5.0.2-dotnet.2737382 - 5.0.2-dotnet.2737382 - 5.0.2-dotnet.2737382 - 5.0.2-dotnet.2737382 - 5.0.2-dotnet.2737382 + 5.0.2-dotnet.2811440 + 5.0.2-dotnet.2811440 + 5.0.2-dotnet.2811440 + 5.0.2-dotnet.2811440 + 5.0.2-dotnet.2811440 + 5.0.2-dotnet.2811440 From 9fd5818bca852fd4fcc6e62f3e655f8d8851d5c8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 17 Oct 2025 02:04:12 +0000 Subject: [PATCH 2/2] Update dependencies from https://github.com/dotnet/dotnet build 287426 Updated Dependencies: Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp, Microsoft.Net.Compilers.Toolset (Version 5.0.0-2.25509.106 -> 5.0.0-2.25515.111) Microsoft.CodeAnalysis.NetAnalyzers, Microsoft.DotNet.ApiCompat.Task (Version 10.0.100-rtm.25509.106 -> 10.0.100) 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 10.0.0-beta.25509.106 -> 10.0.0-beta.25515.111) Microsoft.DotNet.Cecil (Version 0.11.5-alpha.25509.106 -> 0.11.5-alpha.25515.111) Microsoft.DotNet.XUnitAssert, Microsoft.DotNet.XUnitConsoleRunner (Version 2.9.3-beta.25509.106 -> 2.9.3-beta.25515.111) 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 10.0.0-rtm.25509.106 -> 10.0.0) Microsoft.NET.Workload.Emscripten.Current.Manifest-10.0.100.Transport (Version 10.0.100-rtm.25509.106 -> 10.0.100-rtm.25515.111) NuGet.Frameworks, NuGet.Packaging, NuGet.ProjectModel, NuGet.Versioning (Version 7.0.0-rc.1006 -> 7.0.0-rc.1611) System.CommandLine (Version 2.0.0-rtm.25509.106 -> 2.0.0) --- NuGet.config | 5 + eng/Version.Details.props | 78 +++++++------- eng/Version.Details.xml | 158 ++++++++++++++-------------- eng/common/SetupNugetSources.ps1 | 71 +++++++------ eng/common/SetupNugetSources.sh | 173 ++++++++++++++++++------------- global.json | 8 +- 6 files changed, 266 insertions(+), 227 deletions(-) diff --git a/NuGet.config b/NuGet.config index 240b4807a1aa17..2f72d947c80d4f 100644 --- a/NuGet.config +++ b/NuGet.config @@ -7,6 +7,11 @@ + + + + + - 5.0.0-2.25509.106 - 5.0.0-2.25509.106 - 5.0.0-2.25509.106 - 10.0.100-rtm.25509.106 - 10.0.100-rtm.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 0.11.5-alpha.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 10.0.0-beta.25509.106 - 2.9.3-beta.25509.106 - 2.9.3-beta.25509.106 - 10.0.0-beta.25509.106 - 5.0.0-2.25509.106 - 10.0.0-rtm.25509.106 - 10.0.100-rtm.25509.106 - 10.0.0-rtm.25509.106 - 10.0.0-rtm.25509.106 - 7.0.0-rc.1006 - 7.0.0-rc.1006 - 7.0.0-rc.1006 - 7.0.0-rc.1006 - 10.0.0-rtm.25509.106 - 2.0.0-rtm.25509.106 - 10.0.0-rtm.25509.106 - 10.0.0-rtm.25509.106 - 10.0.0-rtm.25509.106 + 5.0.0-2.25515.111 + 5.0.0-2.25515.111 + 5.0.0-2.25515.111 + 10.0.100 + 10.0.100 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 0.11.5-alpha.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 10.0.0-beta.25515.111 + 2.9.3-beta.25515.111 + 2.9.3-beta.25515.111 + 10.0.0-beta.25515.111 + 5.0.0-2.25515.111 + 10.0.0 + 10.0.100-rtm.25515.111 + 10.0.0 + 10.0.0 + 7.0.0-rc.1611 + 7.0.0-rc.1611 + 7.0.0-rc.1611 + 7.0.0-rc.1611 + 10.0.0 + 2.0.0 + 10.0.0 + 10.0.0 + 10.0.0 10.0.0-beta.25418.1 10.0.0-beta.25418.1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 27c28944cf8fb1..19833549f827cf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,5 +1,5 @@ - + https://github.com/dotnet/icu @@ -41,91 +41,91 @@ https://github.com/dotnet/llvm-project 2cfe42ea4a7fe364dcb197beca469af8edec0ad6 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 https://github.com/dotnet/runtime-assets @@ -263,33 +263,33 @@ https://github.com/dotnet/llvm-project 2cfe42ea4a7fe364dcb197beca469af8edec0ad6 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 https://github.com/dotnet/xharness @@ -303,9 +303,9 @@ https://github.com/dotnet/xharness 5b5722171c6c28f6c9f6b6148f148199b9dd0f5b - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -331,29 +331,29 @@ https://github.com/dotnet/runtime-assets 3910cd6230be3d4d283edd6a52bff27f549dd675 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -365,21 +365,21 @@ - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 - + https://github.com/dotnet/dotnet - f448387a0e80f2fdeaec2d2f99ace7284fe37aac + 79c85d969a02abd06c2202949318fd4c21e5e7a0 https://github.com/dotnet/node diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1 index 9445c3143258d7..fc8d618014e0da 100644 --- a/eng/common/SetupNugetSources.ps1 +++ b/eng/common/SetupNugetSources.ps1 @@ -7,7 +7,7 @@ # See example call for this script below. # # - task: PowerShell@2 -# displayName: Setup Private Feeds Credentials +# displayName: Setup internal Feeds Credentials # condition: eq(variables['Agent.OS'], 'Windows_NT') # inputs: # filePath: $(System.DefaultWorkingDirectory)/eng/common/SetupNugetSources.ps1 @@ -34,19 +34,28 @@ Set-StrictMode -Version 2.0 . $PSScriptRoot\tools.ps1 +# Adds or enables the package source with the given name +function AddOrEnablePackageSource($sources, $disabledPackageSources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) { + if ($disabledPackageSources -eq $null -or -not (EnableInternalPackageSource -DisabledPackageSources $disabledPackageSources -Creds $creds -PackageSourceName $SourceName)) { + AddPackageSource -Sources $sources -SourceName $SourceName -SourceEndPoint $SourceEndPoint -Creds $creds -Username $userName -pwd $Password + } +} + # Add source entry to PackageSources function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) { $packageSource = $sources.SelectSingleNode("add[@key='$SourceName']") if ($packageSource -eq $null) { + Write-Host "Adding package source $SourceName" + $packageSource = $doc.CreateElement("add") $packageSource.SetAttribute("key", $SourceName) $packageSource.SetAttribute("value", $SourceEndPoint) $sources.AppendChild($packageSource) | Out-Null } else { - Write-Host "Package source $SourceName already present." + Write-Host "Package source $SourceName already present and enabled." } AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd @@ -59,6 +68,8 @@ function AddCredential($creds, $source, $username, $pwd) { return; } + Write-Host "Inserting credential for feed: " $source + # Looks for credential configuration for the given SourceName. Create it if none is found. $sourceElement = $creds.SelectSingleNode($Source) if ($sourceElement -eq $null) @@ -91,24 +102,27 @@ function AddCredential($creds, $source, $username, $pwd) { $passwordElement.SetAttribute("value", $pwd) } -function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) { - $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") - - Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds." - - ForEach ($PackageSource in $maestroPrivateSources) { - Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key - AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd +# Enable all darc-int package sources. +function EnableMaestroInternalPackageSources($DisabledPackageSources, $Creds) { + $maestroInternalSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") + ForEach ($DisabledPackageSource in $maestroInternalSources) { + EnableInternalPackageSource -DisabledPackageSources $DisabledPackageSources -Creds $Creds -PackageSourceName $DisabledPackageSource.key } } -function EnablePrivatePackageSources($DisabledPackageSources) { - $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") - ForEach ($DisabledPackageSource in $maestroPrivateSources) { - Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource" +# Enables an internal package source by name, if found. Returns true if the package source was found and enabled, false otherwise. +function EnableInternalPackageSource($DisabledPackageSources, $Creds, $PackageSourceName) { + $DisabledPackageSource = $DisabledPackageSources.SelectSingleNode("add[@key='$PackageSourceName']") + if ($DisabledPackageSource) { + Write-Host "Enabling internal source '$($DisabledPackageSource.key)'." + # Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries $DisabledPackageSources.RemoveChild($DisabledPackageSource) + + AddCredential -Creds $creds -Source $DisabledPackageSource.Key -Username $userName -pwd $Password + return $true } + return $false } if (!(Test-Path $ConfigFile -PathType Leaf)) { @@ -121,15 +135,17 @@ $doc = New-Object System.Xml.XmlDocument $filename = (Get-Item $ConfigFile).FullName $doc.Load($filename) -# Get reference to or create one if none exist already +# Get reference to - fail if none exist $sources = $doc.DocumentElement.SelectSingleNode("packageSources") if ($sources -eq $null) { - $sources = $doc.CreateElement("packageSources") - $doc.DocumentElement.AppendChild($sources) | Out-Null + Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. NuGet config file must contain a packageSources section: $ConfigFile" + ExitWithExitCode 1 } $creds = $null +$feedSuffix = "v3/index.json" if ($Password) { + $feedSuffix = "v2" # Looks for a node. Create it if none is found. $creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials") if ($creds -eq $null) { @@ -138,33 +154,22 @@ if ($Password) { } } +$userName = "dn-bot" + # Check for disabledPackageSources; we'll enable any darc-int ones we find there $disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources") if ($disabledSources -ne $null) { Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node" - EnablePrivatePackageSources -DisabledPackageSources $disabledSources -} - -$userName = "dn-bot" - -# Insert credential nodes for Maestro's private feeds -InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password - -# 3.1 uses a different feed url format so it's handled differently here -$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']") -if ($dotnet31Source -ne $null) { - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password + EnableMaestroInternalPackageSources -DisabledPackageSources $disabledSources -Creds $creds } - $dotnetVersions = @('5','6','7','8','9','10') foreach ($dotnetVersion in $dotnetVersions) { $feedPrefix = "dotnet" + $dotnetVersion; $dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']") if ($dotnetSource -ne $null) { - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password + AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password } } diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh index ddf4efc81a4a34..b97cc536379dfe 100755 --- a/eng/common/SetupNugetSources.sh +++ b/eng/common/SetupNugetSources.sh @@ -52,78 +52,124 @@ if [[ `uname -s` == "Darwin" ]]; then TB='' fi -# Ensure there is a ... section. -grep -i "" $ConfigFile -if [ "$?" != "0" ]; then - echo "Adding ... section." - ConfigNodeHeader="" - PackageSourcesTemplate="${TB}${NL}${TB}" +# Enables an internal package source by name, if found. Returns 0 if found and enabled, 1 if not found. +EnableInternalPackageSource() { + local PackageSourceName="$1" + + # Check if disabledPackageSources section exists + grep -i "" "$ConfigFile" > /dev/null + if [ "$?" != "0" ]; then + return 1 # No disabled sources section + fi + + # Check if this source name is disabled + grep -i " /dev/null + if [ "$?" == "0" ]; then + echo "Enabling internal source '$PackageSourceName'." + # Remove the disabled entry (including any surrounding comments or whitespace on the same line) + sed -i.bak "//d" "$ConfigFile" + + # Add the source name to PackageSources for credential handling + PackageSources+=("$PackageSourceName") + return 0 # Found and enabled + fi + + return 1 # Not found in disabled sources +} + +# Add source entry to PackageSources +AddPackageSource() { + local SourceName="$1" + local SourceEndPoint="$2" + + # Check if source already exists + grep -i " /dev/null + if [ "$?" == "0" ]; then + echo "Package source $SourceName already present and enabled." + PackageSources+=("$SourceName") + return + fi + + echo "Adding package source $SourceName" + PackageSourcesNodeFooter="" + PackageSourceTemplate="${TB}" + + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" "$ConfigFile" + PackageSources+=("$SourceName") +} + +# Adds or enables the package source with the given name +AddOrEnablePackageSource() { + local SourceName="$1" + local SourceEndPoint="$2" + + # Try to enable if disabled, if not found then add new source + EnableInternalPackageSource "$SourceName" + if [ "$?" != "0" ]; then + AddPackageSource "$SourceName" "$SourceEndPoint" + fi +} - sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" $ConfigFile -fi +# Enable all darc-int package sources +EnableMaestroInternalPackageSources() { + # Check if disabledPackageSources section exists + grep -i "" "$ConfigFile" > /dev/null + if [ "$?" != "0" ]; then + return # No disabled sources section + fi + + # Find all darc-int disabled sources + local DisabledDarcIntSources=() + DisabledDarcIntSources+=$(grep -oh '"darc-int-[^"]*" value="true"' "$ConfigFile" | tr -d '"') + + for DisabledSourceName in ${DisabledDarcIntSources[@]} ; do + if [[ $DisabledSourceName == darc-int* ]]; then + EnableInternalPackageSource "$DisabledSourceName" + fi + done +} -# Ensure there is a ... section. -grep -i "" $ConfigFile +# Ensure there is a ... section. +grep -i "" $ConfigFile if [ "$?" != "0" ]; then - echo "Adding ... section." - - PackageSourcesNodeFooter="" - PackageSourceCredentialsTemplate="${TB}${NL}${TB}" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" $ConfigFile + Write-PipelineTelemetryError -Category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. NuGet config file must contain a packageSources section: $ConfigFile" + ExitWithExitCode 1 fi PackageSources=() -# Ensure dotnet3.1-internal and dotnet3.1-internal-transport are in the packageSources if the public dotnet3.1 feeds are present -grep -i "... section. + grep -i "" $ConfigFile if [ "$?" != "0" ]; then - echo "Adding dotnet3.1-internal to the packageSources." - PackageSourcesNodeFooter="" - PackageSourceTemplate="${TB}" + echo "Adding ... section." - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=('dotnet3.1-internal') - - grep -i "" $ConfigFile - if [ "$?" != "0" ]; then - echo "Adding dotnet3.1-internal-transport to the packageSources." PackageSourcesNodeFooter="" - PackageSourceTemplate="${TB}" + PackageSourceCredentialsTemplate="${TB}${NL}${TB}" - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" $ConfigFile fi - PackageSources+=('dotnet3.1-internal-transport') +fi + +# Check for disabledPackageSources; we'll enable any darc-int ones we find there +grep -i "" $ConfigFile > /dev/null +if [ "$?" == "0" ]; then + echo "Checking for any darc-int disabled package sources in the disabledPackageSources node" + EnableMaestroInternalPackageSources fi DotNetVersions=('5' '6' '7' '8' '9' '10') for DotNetVersion in ${DotNetVersions[@]} ; do FeedPrefix="dotnet${DotNetVersion}"; - grep -i " /dev/null if [ "$?" == "0" ]; then - grep -i "" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=("$FeedPrefix-internal") - - grep -i "" $ConfigFile - if [ "$?" != "0" ]; then - echo "Adding $FeedPrefix-internal-transport to the packageSources." - PackageSourcesNodeFooter="" - PackageSourceTemplate="${TB}" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=("$FeedPrefix-internal-transport") + AddOrEnablePackageSource "$FeedPrefix-internal" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$FeedPrefix-internal/nuget/$FeedSuffix" + AddOrEnablePackageSource "$FeedPrefix-internal-transport" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$FeedPrefix-internal-transport/nuget/$FeedSuffix" fi done @@ -139,29 +185,12 @@ if [ "$CredToken" ]; then # Check if there is no existing credential for this FeedName grep -i "<$FeedName>" $ConfigFile if [ "$?" != "0" ]; then - echo "Adding credentials for $FeedName." + echo " Inserting credential for feed: $FeedName" PackageSourceCredentialsNodeFooter="" - NewCredential="${TB}${TB}<$FeedName>${NL}${NL}${NL}" + NewCredential="${TB}${TB}<$FeedName>${NL}${TB}${NL}${TB}${TB}${NL}${TB}${TB}" sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile fi done fi - -# Re-enable any entries in disabledPackageSources where the feed name contains darc-int -grep -i "" $ConfigFile -if [ "$?" == "0" ]; then - DisabledDarcIntSources=() - echo "Re-enabling any disabled \"darc-int\" package sources in $ConfigFile" - DisabledDarcIntSources+=$(grep -oh '"darc-int-[^"]*" value="true"' $ConfigFile | tr -d '"') - for DisabledSourceName in ${DisabledDarcIntSources[@]} ; do - if [[ $DisabledSourceName == darc-int* ]] - then - OldDisableValue="" - NewDisableValue="" - sed -i.bak "s|$OldDisableValue|$NewDisableValue|" $ConfigFile - echo "Neutralized disablePackageSources entry for '$DisabledSourceName'" - fi - done -fi diff --git a/global.json b/global.json index 038a7e3c00a758..70e4ca6d22711e 100644 --- a/global.json +++ b/global.json @@ -8,11 +8,11 @@ "dotnet": "10.0.100-rc.1.25451.107" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25509.106", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25509.106", - "Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25509.106", + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25515.111", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25515.111", + "Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25515.111", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", - "Microsoft.NET.Sdk.IL": "10.0.0-rtm.25509.106" + "Microsoft.NET.Sdk.IL": "10.0.0" } }