From 6adadc0e502ced2d770f8b716149630f227d2219 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 22:11:53 +0000 Subject: [PATCH 1/7] Backport CI/product stability fixes from #53424 to release/10.0.4xx Agent-Logs-Url: https://github.com/dotnet/sdk/sessions/27b803cc-133f-4af1-ab61-72f538241b6f Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- .../src/Microsoft.CodeAnalysis.NetAnalyzers.sarif | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.sarif b/src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.sarif index 27d7bb09406c..ebd5d4d08854 100644 --- a/src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.sarif +++ b/src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.sarif @@ -1,4 +1,4 @@ -{ +{ "$schema": "http://json.schemastore.org/sarif-1.0.0", "version": "1.0.0", "runs": [ @@ -7111,4 +7111,4 @@ } } ] -} +} \ No newline at end of file From 3373a6f0e96c14066660f32117f790639cc5efa2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 23:45:05 +0000 Subject: [PATCH 2/7] Backport gzip retry logic and redirected-input console guard from #53424 Agent-Logs-Url: https://github.com/dotnet/sdk/sessions/5192c5c0-d146-4b9d-aa26-8cbc9d4f7cb2 Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com> --- src/BlazorWasmSdk/Tasks/GZipCompress.cs | 37 ++++++++++++++------ src/Dotnet.Watch/Watch/UI/PhysicalConsole.cs | 10 +++++- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/BlazorWasmSdk/Tasks/GZipCompress.cs b/src/BlazorWasmSdk/Tasks/GZipCompress.cs index 96481d04a91b..b5edfd894c14 100644 --- a/src/BlazorWasmSdk/Tasks/GZipCompress.cs +++ b/src/BlazorWasmSdk/Tasks/GZipCompress.cs @@ -20,6 +20,10 @@ public class GZipCompress : Task [Required] public string OutputDirectory { get; set; } + // Retry count for transient file I/O errors (e.g., antivirus locks on CI machines). + private const int MaxRetries = 3; + private const int RetryDelayMs = 200; + public override bool Execute() { CompressedFiles = new ITaskItem[FilesToCompress.Length]; @@ -56,18 +60,31 @@ public override bool Execute() Log.LogMessage(MessageImportance.Low, "Compressing '{0}' because file is newer than '{1}'.", inputFullPath, outputRelativePath); } - try + // Retry on IOException to handle transient file locks from antivirus, file + // indexing, or parallel MSBuild nodes on CI machines (see dotnet/sdk#53424). + for (int attempt = 1; attempt <= MaxRetries; attempt++) { - using var sourceStream = File.OpenRead(file.ItemSpec); - using var fileStream = File.Create(outputRelativePath); - using var stream = new GZipStream(fileStream, CompressionLevel.Optimal); + try + { + using var sourceStream = File.OpenRead(file.ItemSpec); + using var fileStream = File.Create(outputRelativePath); + using var stream = new GZipStream(fileStream, CompressionLevel.Optimal); - sourceStream.CopyTo(stream); - } - catch (Exception e) - { - Log.LogErrorFromException(e); - return; + sourceStream.CopyTo(stream); + return; // Success + } + catch (IOException) when (attempt < MaxRetries) + { + Log.LogMessage(MessageImportance.Low, + "Retrying compression of '{0}' (attempt {1}/{2}) due to transient I/O error.", + file.ItemSpec, attempt, MaxRetries); + Thread.Sleep(RetryDelayMs * attempt); + } + catch (Exception e) + { + Log.LogErrorFromException(e); + return; + } } }); diff --git a/src/Dotnet.Watch/Watch/UI/PhysicalConsole.cs b/src/Dotnet.Watch/Watch/UI/PhysicalConsole.cs index e499829d46d0..0e6004612093 100644 --- a/src/Dotnet.Watch/Watch/UI/PhysicalConsole.cs +++ b/src/Dotnet.Watch/Watch/UI/PhysicalConsole.cs @@ -13,7 +13,15 @@ internal sealed class PhysicalConsole : IConsole public PhysicalConsole(TestFlags testFlags) { Console.OutputEncoding = Encoding.UTF8; - _ = testFlags.HasFlag(TestFlags.ReadKeyFromStdin) ? ListenToStandardInputAsync() : ListenToConsoleKeyPressAsync(); + + if (testFlags.HasFlag(TestFlags.ReadKeyFromStdin)) + { + _ = ListenToStandardInputAsync(); + } + else if (!Console.IsInputRedirected) + { + _ = ListenToConsoleKeyPressAsync(); + } } private async Task ListenToStandardInputAsync() From f34ff92ec4f47521c670016cc8d1f4e6e867c21d Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Mon, 25 May 2026 10:41:56 +0200 Subject: [PATCH 3/7] Allow some duplicate #: directives (#54206) --- documentation/general/dotnet-run-file.md | 14 +- .../FileLevelDirectiveHelpers.cs | 44 +++++- .../InternalAPI.Unshipped.txt | 2 +- .../VirtualProjectBuilder.cs | 58 +++++++- .../Convert/DotnetProjectConvertTests.cs | 113 ++++++++++++++ .../Run/RunFileTests_Directives.cs | 140 +++++++++++++++--- 6 files changed, 335 insertions(+), 36 deletions(-) diff --git a/documentation/general/dotnet-run-file.md b/documentation/general/dotnet-run-file.md index a18f4591ac02..e063eb46b4dc 100644 --- a/documentation/general/dotnet-run-file.md +++ b/documentation/general/dotnet-run-file.md @@ -267,12 +267,14 @@ We do not limit these directives to appear only in entry point files because it - which also makes it possible to share it independently or symlink it to multiple script folders, - and it's similar to `global using`s which users usually put into a single file but don't have to. -We disallow duplicate `#:` directives (except `#:project` and `#:ref`) to allow us to design some deduplication mechanism in the future. -Specifically, directives are considered duplicate if their type and name (case insensitive) are equal. -`#:project` and `#:ref` duplicates are allowed because MSBuild allows duplicate `` items. -Later with deduplication, separate "self-contained" utilities could reference overlapping sets of packages -even if they end up in the same compilation. -For example, properties could be concatenated via `;`, more specific package versions could override less specific ones. +Duplicate directives are handled according to the MSBuild construct they represent. +For `#:sdk`, `#:property`, and `#:package`, directives are considered duplicate if their kind and name are equal case-insensitively. +If the duplicate has the same unevaluated value (before any MSBuild variable expansion), it is ignored. +If the duplicate has a different unevaluated value, it is an error (which might be relaxed in the future with smarter deduplication, +for example, properties could be concatenated via `;`, more specific package versions could override less specific ones.) +For `#:project`, `#:ref`, `#:include`, and `#:exclude`, duplicates are allowed and translated to the corresponding MSBuild items. +Any resulting item behavior, including warnings for duplicate `Compile` items, is left to MSBuild and the compiler. +Directive deduplication allows separate "self-contained" utilities to e.g. reference overlapping sets of packages even if they end up in the same compilation. During [grow up](#grow-up), `#:` directives are removed from the `.cs` files and turned into elements in the converted `.csproj` file when needed. Files included with `#:include` are copied into the converted project directory; if an included file is not picked up by the converted project's defaults, the corresponding project item is also written explicitly into an `` in the converted project. diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs index 1300e67094d1..c038e131e753 100644 --- a/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs +++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs @@ -159,7 +159,7 @@ public static void FindLeadingDirectives( { if (checkDuplicates) { - deduplicator.CheckDirective(directive, errorReporter); + deduplicator.CheckDirective(directive, errorReporter, shouldKeep: out _); } builder?.Add(directive); @@ -875,23 +875,24 @@ void ReportError(string message) /// /// Detects duplicate directives (by type and case-insensitive name) -/// and reports errors via the provided . +/// and reports errors via the provided when their values differ. /// /// -/// #:project and #:ref duplicates are allowed (MSBuild can handle multiple ProjectReferences). +/// #:project, #:ref, #:include, and #:exclude duplicates are allowed (MSBuild can handle them). /// internal struct DirectiveDeduplicator { private Dictionary? _seen; /// - /// Checks for duplication and reports an error if it was already seen. + /// Checks for duplication and reports an error if a different unevaluated value was already seen. /// - public void CheckDirective(CSharpDirective.Named directive, ErrorReporter reportError) + /// if a duplicate directive was already seen and this directive should be skipped. + public void CheckDirective(CSharpDirective.Named directive, ErrorReporter reportError, out bool shouldKeep) { - // Duplicate #:project and #:ref directives are allowed (MSBuild can handle that). - if (directive is CSharpDirective.Project or CSharpDirective.Ref) + if (directive is CSharpDirective.Project or CSharpDirective.Ref or CSharpDirective.IncludeOrExclude) { + shouldKeep = true; return; } @@ -899,14 +900,43 @@ public void CheckDirective(CSharpDirective.Named directive, ErrorReporter report if (_seen.TryGetValue(directive, out var existingDirective)) { + if (HasSameValue(existingDirective, directive)) + { + shouldKeep = false; + return; + } + var typeAndName = $"#:{existingDirective.KindToString()} {existingDirective.Name}"; reportError(directive.Info.SourceFile.Text, directive.Info.SourceFile.Path, directive.Info.Span, string.Format(FileBasedProgramsResources.DuplicateDirective, typeAndName)); + + shouldKeep = false; + return; } else { _seen.Add(directive, directive); } + + shouldKeep = true; + } + + private static bool HasSameValue(CSharpDirective.Named existingDirective, CSharpDirective.Named directive) + { + Debug.Assert(NamedDirectiveComparer.Instance.Equals(existingDirective, directive)); + Debug.Assert(existingDirective is CSharpDirective.Sdk or CSharpDirective.Property or CSharpDirective.Package); + Debug.Assert(directive is CSharpDirective.Sdk or CSharpDirective.Property or CSharpDirective.Package); + + return (existingDirective, directive) switch + { + (CSharpDirective.Sdk existing, CSharpDirective.Sdk current) => + string.Equals(existing.Version, current.Version, StringComparison.Ordinal), + (CSharpDirective.Property existing, CSharpDirective.Property current) => + string.Equals(existing.Value, current.Value, StringComparison.Ordinal), + (CSharpDirective.Package existing, CSharpDirective.Package current) => + string.Equals(existing.Version, current.Version, StringComparison.Ordinal), + _ => false, + }; } } diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/InternalAPI.Unshipped.txt b/src/Cli/Microsoft.DotNet.FileBasedPrograms/InternalAPI.Unshipped.txt index 5ff50d57b0c2..d5c73fc0ca30 100644 --- a/src/Cli/Microsoft.DotNet.FileBasedPrograms/InternalAPI.Unshipped.txt +++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/InternalAPI.Unshipped.txt @@ -90,7 +90,7 @@ Microsoft.DotNet.FileBasedPrograms.CSharpDirective.Sdk.Version.init -> void Microsoft.DotNet.FileBasedPrograms.CSharpDirective.Shebang Microsoft.DotNet.FileBasedPrograms.CSharpDirective.Shebang.Shebang(in Microsoft.DotNet.FileBasedPrograms.CSharpDirective.ParseInfo info) -> void Microsoft.DotNet.FileBasedPrograms.DirectiveDeduplicator -Microsoft.DotNet.FileBasedPrograms.DirectiveDeduplicator.CheckDirective(Microsoft.DotNet.FileBasedPrograms.CSharpDirective.Named! directive, Microsoft.DotNet.FileBasedPrograms.ErrorReporter! reportError) -> void +Microsoft.DotNet.FileBasedPrograms.DirectiveDeduplicator.CheckDirective(Microsoft.DotNet.FileBasedPrograms.CSharpDirective.Named! directive, Microsoft.DotNet.FileBasedPrograms.ErrorReporter! reportError, out bool shouldKeep) -> void Microsoft.DotNet.FileBasedPrograms.DirectiveDeduplicator.DirectiveDeduplicator() -> void Microsoft.DotNet.FileBasedPrograms.ErrorReporter Microsoft.DotNet.FileBasedPrograms.ErrorReporters diff --git a/src/Microsoft.DotNet.ProjectTools/VirtualProjectBuilder.cs b/src/Microsoft.DotNet.ProjectTools/VirtualProjectBuilder.cs index cf0c9d57dc65..1d1c78d7c381 100644 --- a/src/Microsoft.DotNet.ProjectTools/VirtualProjectBuilder.cs +++ b/src/Microsoft.DotNet.ProjectTools/VirtualProjectBuilder.cs @@ -128,7 +128,7 @@ public static bool TryGetEntryPointFilePathFromVirtualProjectPath(string project var sourceFile = SourceFile.Load(sourceFilePath); var directives = FileLevelDirectiveHelpers.FindDirectives(sourceFile, reportAllErrors: false, ErrorReporters.IgnoringReporter); - // Return the first value. Duplicate directives are not supported. + // Return the first value. Conflicting duplicate directives are not supported. return directives.OfType() .FirstOrDefault(p => string.Equals(p.Name, propertyName, StringComparison.OrdinalIgnoreCase))?.Value; } @@ -324,24 +324,42 @@ internal void CreateProjectInstance( do { + var directivesForEvaluation = DeduplicateSdkDirectives(directives); + // Create a project with properties from #:property directives so they can be expanded inside EvaluateDirectives. (project, projectRootElement) = CreateProjectInstanceNoEvaluation( projectCollection, - [.. evaluatedDirectiveBuilder, .. directives], + [.. evaluatedDirectiveBuilder, .. directivesForEvaluation], addGlobalProperties); // Evaluate directives, e.g., determine item types for #:include/#:exclude from their file extension. - var fileEvaluatedDirectives = EvaluateDirectives(project, directives, reportError); + var fileEvaluatedDirectives = EvaluateDirectives(project, directivesForEvaluation, reportError); - // Detect duplicate directives across all files on evaluated directives. + // Detect duplicate directives across all files on evaluated directives. EvaluateDirectives only expands + // #:project, #:ref, #:include, and #:exclude; #:property and #:package values are still unevaluated here. + var deduplicatedFileEvaluatedDirectiveBuilder = ImmutableArray.CreateBuilder(fileEvaluatedDirectives.Length); foreach (var directive in fileEvaluatedDirectives) { + if (directive is CSharpDirective.Sdk) + { + deduplicatedFileEvaluatedDirectiveBuilder.Add(directive); + continue; + } + if (directive is CSharpDirective.Named named) { - deduplicator.CheckDirective(named, reportError); + deduplicator.CheckDirective(named, reportError, out bool shouldKeep); + if (!shouldKeep) + { + continue; + } } + + deduplicatedFileEvaluatedDirectiveBuilder.Add(directive); } + fileEvaluatedDirectives = deduplicatedFileEvaluatedDirectiveBuilder.DrainToImmutable(); + evaluatedDirectiveBuilder.AddRange(fileEvaluatedDirectives); if (fileEvaluatedDirectives != directives) @@ -390,6 +408,36 @@ bool TryGetNextFileToProcess() return false; } + // #:sdk directives become Sdk.props/Sdk.targets imports when creating the temporary project used for + // directive evaluation, so identical duplicates must be removed before that project is created. + ImmutableArray DeduplicateSdkDirectives(ImmutableArray directives) + { + if (!directives.Any(static directive => directive is CSharpDirective.Sdk)) + { + return directives; + } + + var builder = ImmutableArray.CreateBuilder(directives.Length); + var changed = false; + + foreach (var directive in directives) + { + if (directive is CSharpDirective.Sdk sdk) + { + deduplicator.CheckDirective(sdk, reportError, out bool shouldKeep); + if (!shouldKeep) + { + changed = true; + continue; + } + } + + builder.Add(directive); + } + + return changed ? builder.DrainToImmutable() : directives; + } + (ProjectInstance, ProjectRootElement) CreateProjectInstanceNoEvaluation( ProjectCollection projectCollection, ImmutableArray directives, diff --git a/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs b/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs index 382953a3c02b..4e5d1aabef9a 100644 --- a/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs +++ b/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs @@ -2766,6 +2766,117 @@ public void Directives_Comments() """); } + [Fact] + public void Directives_IdenticalDuplicate() + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + VerifyConversion( + baseDirectory: testInstance.Path, + inputCSharp: """ + #:sdk Microsoft.NET.Sdk + #:sdk Microsoft.NET.Sdk + #:package Package@1.0 + #:package Package@1.0 + #:property Prop=1 + #:property Prop=1 + Console.Write(); + """, + expectedProject: $""" + + + + Exe + {ToolsetInfo.CurrentTargetFramework} + enable + enable + true + true + 1 + + + + + + + + + """, + expectedCSharp: """ + Console.Write(); + """, + evaluateDirectives: true); + } + + [Fact] + public void Directives_Duplicate_UsesUnevaluatedValues() + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + VerifyConversion( + baseDirectory: testInstance.Path, + inputCSharp: """ + #:property A=a + #:property B=b + #:property B=b + #:property C=a + #:property C=$(A) + #:property D=$(A) + #:property D=$(A) + Console.Write(); + """, + expectedProject: null, + expectedCSharp: """ + Console.Write(); + """, + expectedErrors: + [ + (5, string.Format(FileBasedProgramsResources.DuplicateDirective, "#:property C")), + ], + evaluateDirectives: true); + } + + [Fact] + public void Directives_Duplicate_EvaluatedProjectDirectivesAreAllowed() + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + File.WriteAllText(Path.Join(testInstance.Path, "Lib.csproj"), """ + + """); + + VerifyConversion( + baseDirectory: testInstance.Path, + inputCSharp: """ + #:property LibraryProject=Lib.csproj + #:project Lib.csproj + #:project $(LibraryProject) + Console.Write(); + """, + expectedProject: $""" + + + + Exe + {ToolsetInfo.CurrentTargetFramework} + enable + enable + true + true + Lib.csproj + + + + + + + + + + """, + expectedCSharp: """ + Console.Write(); + """, + evaluateDirectives: true); + } + [Fact] public void Directives_Duplicate() { @@ -2787,6 +2898,7 @@ public void Directives_Duplicate() inputCSharp: """ #:sdk Name #:sdk Name@X + #:sdk Name@Y #:sdk Name #:sdk Name2 """, @@ -2802,6 +2914,7 @@ public void Directives_Duplicate() inputCSharp: """ #:package Name #:package Name@X + #:package Name@Y #:package Name #:package Name2 """, diff --git a/test/dotnet.Tests/CommandTests/Run/RunFileTests_Directives.cs b/test/dotnet.Tests/CommandTests/Run/RunFileTests_Directives.cs index 1fe7087824db..09482ba7db57 100644 --- a/test/dotnet.Tests/CommandTests/Run/RunFileTests_Directives.cs +++ b/test/dotnet.Tests/CommandTests/Run/RunFileTests_Directives.cs @@ -1683,17 +1683,14 @@ public void UserSecrets(bool useIdArg, string? userSecretsId) } /// - /// Duplicate directives across #:include'd files should be reported as errors. - /// Note: #:project and #:ref duplicates are allowed - /// (tested by and ). + /// Identical duplicate directives across #:include'd files should be allowed. /// [Theory] [InlineData("package")] [InlineData("property")] [InlineData("sdk")] - [InlineData("include")] [InlineData("exclude")] - public void IncludeDirective_DuplicateDirectives(string directiveKind) + public void IncludeDirective_IdenticalDuplicateDirectives(string directiveKind) { var testInstance = _testAssetsManager.CreateTestDirectory(); @@ -1702,13 +1699,107 @@ public void IncludeDirective_DuplicateDirectives(string directiveKind) string programDirective; string utilDirective; - string duplicateTypeAndName; switch (directiveKind) { case "package": programDirective = "#:package System.CommandLine@2.0.0-beta4.22272.1"; utilDirective = "#:package System.CommandLine@2.0.0-beta4.22272.1"; + break; + case "property": + programDirective = "#:property MyProp=Value"; + utilDirective = "#:property MyProp=Value"; + break; + case "sdk": + programDirective = "#:sdk Microsoft.NET.Sdk"; + utilDirective = "#:sdk Microsoft.NET.Sdk"; + break; + case "exclude": + programDirective = "#:exclude Helper.cs"; + utilDirective = "#:exclude Helper.cs"; + break; + default: + throw new ArgumentException($"Unsupported directive kind '{directiveKind}'.", nameof(directiveKind)); + } + + File.WriteAllText(programPath, $""" + #!/usr/bin/env dotnet + #:include Util.cs + {programDirective} + Console.WriteLine("Hello"); + """); + + File.WriteAllText(utilPath, $$""" + {{utilDirective}} + static class Util { } + """); + + new DotnetCommand(Log, "run", "Program.cs") + .WithWorkingDirectory(testInstance.Path) + .Execute() + .Should().Pass() + .And.HaveStdOut("Hello"); + } + + [Fact] + public void IncludeDirective_IdenticalDuplicateIncludeDirectivesAreAllowed() + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + + var programPath = Path.Join(testInstance.Path, "Program.cs"); + var utilPath = Path.Join(testInstance.Path, "Util.cs"); + + File.WriteAllText(programPath, """ + #!/usr/bin/env dotnet + #:include Util.cs + #:include Helper.cs + Console.WriteLine("Hello"); + """); + + File.WriteAllText(utilPath, """ + #:include Helper.cs + static class Util { } + """); + + var helperPath = Path.Join(testInstance.Path, "Helper.cs"); + File.WriteAllText(helperPath, """ + static class Helper { } + """); + + new DotnetCommand(Log, "run", "Program.cs") + .WithWorkingDirectory(testInstance.Path) + .Execute() + .Should().Pass() + // warning CS2002: Source file 'Helper.cs' specified multiple times + .And.HaveStdOutContaining("warning CS2002") + .And.HaveStdOutContaining(helperPath) + .And.HaveStdOutContaining("Hello"); + } + + /// + /// Conflicting duplicate directives across #:include'd files should be reported as errors. + /// Note: #:project, #:ref, #:include, and #:exclude duplicates are allowed. + /// + [Theory] + [InlineData("package")] + [InlineData("property")] + [InlineData("sdk")] + public void IncludeDirective_ConflictingDuplicateDirectives(string directiveKind) + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + + var programPath = Path.Join(testInstance.Path, "Program.cs"); + var utilPath = Path.Join(testInstance.Path, "Util.cs"); + + string programDirective; + string utilDirective; + string duplicateTypeAndName; + + switch (directiveKind) + { + case "package": + programDirective = "#:package System.CommandLine@2.0.0-beta4.22272.1"; + utilDirective = "#:package System.CommandLine@2.0.0-beta4.22537.1"; duplicateTypeAndName = "#:package System.CommandLine"; break; case "property": @@ -1721,22 +1812,12 @@ public void IncludeDirective_DuplicateDirectives(string directiveKind) utilDirective = "#:sdk Microsoft.NET.Sdk@9.0.0"; duplicateTypeAndName = "#:sdk Microsoft.NET.Sdk"; break; - case "include": - File.WriteAllText(Path.Join(testInstance.Path, "Helper.cs"), "static class Helper { }"); - programDirective = "#:include Helper.cs"; - utilDirective = "#:include Helper.cs"; - duplicateTypeAndName = $"#:include {Path.Join(testInstance.Path, "Helper.cs")}"; - break; - case "exclude": - programDirective = "#:exclude Helper.cs"; - utilDirective = "#:exclude Helper.cs"; - duplicateTypeAndName = $"#:exclude {Path.Join(testInstance.Path, "Helper.cs")}"; - break; default: throw new ArgumentException($"Unsupported directive kind '{directiveKind}'.", nameof(directiveKind)); } File.WriteAllText(programPath, $""" + #!/usr/bin/env dotnet #:include Util.cs {programDirective} Console.WriteLine("Hello"); @@ -1753,4 +1834,29 @@ static class Util { } .Should().Fail() .And.HaveStdErrContaining(DirectiveError(utilPath, 1, FileBasedProgramsResources.DuplicateDirective, duplicateTypeAndName)); } + + [Fact] + public void IncludeDirective_IncludeAndExcludeSamePathAreAllowed() + { + var testInstance = _testAssetsManager.CreateTestDirectory(); + + var programPath = Path.Join(testInstance.Path, "Program.cs"); + + File.WriteAllText(programPath, """ + #!/usr/bin/env dotnet + #:include Helper.cs + #:exclude Helper.cs + Console.WriteLine("Hello"); + """); + + File.WriteAllText(Path.Join(testInstance.Path, "Helper.cs"), """ + #error This file should not be compiled. + """); + + new DotnetCommand(Log, "run", "Program.cs") + .WithWorkingDirectory(testInstance.Path) + .Execute() + .Should().Pass() + .And.HaveStdOut("Hello"); + } } From e9bc8a8dd6d557f7612a21e1d619410d2ad4eb52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Fri, 6 Mar 2026 15:25:25 +0100 Subject: [PATCH 4/7] Fix --environment variables not applied without launch profile Environment variables specified via --environment (-e) on the command line were only applied when a launch profile was present. If no launch profile existed (or --no-launch-profile was used), the variables were silently ignored. Move the command-line env var loop outside of the launch profile block, matching the behavior of 'dotnet run' which always applies command-line env vars regardless of launch profile presence. The command-line vars still override launch profile vars when both are present. --- src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs index d5d733a17044..645e86d57782 100644 --- a/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs +++ b/src/Cli/dotnet/Commands/Test/MTP/TestApplication.cs @@ -146,12 +146,6 @@ private ProcessStartInfo CreateProcessStartInfo() processStartInfo.Environment[entry.Key] = entry.Value; } - // Env variables specified on command line override those specified in launch profile: - foreach (var (name, value) in TestOptions.EnvironmentVariables) - { - processStartInfo.Environment[name] = value; - } - if (!_buildOptions.NoLaunchProfileArguments && !string.IsNullOrEmpty(Module.LaunchSettings.CommandLineArgs)) { @@ -159,6 +153,12 @@ private ProcessStartInfo CreateProcessStartInfo() } } + // Env variables specified on command line override those specified in launch profile: + foreach (var (name, value) in TestOptions.EnvironmentVariables) + { + processStartInfo.Environment[name] = value; + } + if (Module.DotnetRootArchVariableName is not null) { processStartInfo.Environment[Module.DotnetRootArchVariableName] = Path.GetDirectoryName(new Muxer().MuxerPath); From 45d706660fe495f7f1b3ca0c24c2585a299215c6 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Wed, 27 May 2026 17:15:11 +0200 Subject: [PATCH 5/7] Add Microsoft.DotNet.ProjectTools.csproj to cli.slnf (#54411) Co-authored-by: Ella Hathaway <67609881+ellahathaway@users.noreply.github.com> --- cli.slnf | 1 + 1 file changed, 1 insertion(+) diff --git a/cli.slnf b/cli.slnf index 82fdbf143408..e65ba13c3432 100644 --- a/cli.slnf +++ b/cli.slnf @@ -5,6 +5,7 @@ "src\\Dotnet.Watch\\dotnet-watch\\dotnet-watch.csproj", "src\\Cli\\dotnet\\dotnet.csproj", "src\\Cli\\Microsoft.DotNet.Cli.Utils\\Microsoft.DotNet.Cli.Utils.csproj", + "src\\Microsoft.DotNet.ProjectTools\\Microsoft.DotNet.ProjectTools.csproj", "test\\dotnet-new.IntegrationTests\\dotnet-new.IntegrationTests.csproj", "test\\dotnet-watch.Tests\\dotnet-watch.Tests.csproj", "test\\dotnet.Tests\\dotnet.Tests.csproj", From 0c06be5af9662bf45df01d6837eecf8ac504d2e6 Mon Sep 17 00:00:00 2001 From: Jan Jones Date: Fri, 29 May 2026 10:49:42 +0200 Subject: [PATCH 6/7] File-based apps: support `#:include .dll` by default (#54396) --- documentation/general/dotnet-run-file.md | 2 +- .../FileLevelDirectiveHelpers.cs | 5 +++-- .../Project/Convert/DotnetProjectConvertTests.cs | 11 +++-------- .../CommandTests/Run/RunFileTests_CscOnlyAndApi.cs | 8 ++++---- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/documentation/general/dotnet-run-file.md b/documentation/general/dotnet-run-file.md index e063eb46b4dc..36417e058205 100644 --- a/documentation/general/dotnet-run-file.md +++ b/documentation/general/dotnet-run-file.md @@ -235,7 +235,7 @@ The directives are processed as follows: - Each `#:include` is injected as `<{1} Include="{0}" />` in an `` where `{0}` is the directive's value and `{1}` is determined by its extension. The mapping can be customized by setting the MSBuild property `FileBasedProgramsItemMapping` - which is by default set to `.cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content`. + which is by default set to `.cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content;.dll=Reference`. It is an error if the value is empty. diff --git a/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs index c038e131e753..9d4e7fb64f93 100644 --- a/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs +++ b/src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs @@ -692,7 +692,7 @@ public sealed class IncludeOrExclude(in ParseInfo info) : Named(info) { public const string MappingPropertyName = "FileBasedProgramsItemMapping"; - public static string DefaultMappingString => ".cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content"; + public static string DefaultMappingString => ".cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content;.dll=Reference"; public static ImmutableArray<(string Extension, string ItemType)> DefaultMapping { @@ -706,6 +706,7 @@ public sealed class IncludeOrExclude(in ParseInfo info) : Named(info) (".resx", "EmbeddedResource"), (".json", "None"), (".razor", "Content"), + (".dll", "Reference"), ]; } @@ -833,7 +834,7 @@ public string KindToMSBuildString() SourceFile sourceFile, ErrorReporter errorReporter) { - var pairs = value.Split(';'); + var pairs = value.Split([';'], StringSplitOptions.RemoveEmptyEntries); var builder = ImmutableArray.CreateBuilder<(string Extension, string ItemType)>(pairs.Length); diff --git a/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs b/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs index 4e5d1aabef9a..471b27f34cbb 100644 --- a/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs +++ b/test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs @@ -1821,7 +1821,6 @@ public static class LibClass var libDllProjectPath = Path.Join("Lib", "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "Lib.dll"); File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $$""" - #:property FileBasedProgramsItemMapping=.dll=Reference #:include {{libDllDirectivePath}} Console.WriteLine(Lib.LibClass.GetMessage()); """); @@ -1851,7 +1850,6 @@ public static class LibClass true true Program-* - .dll=Reference @@ -1908,7 +1906,6 @@ public static class LibClass Path.Join(testInstance.Path, "Lib.dll")); File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ - #:property FileBasedProgramsItemMapping=.dll=Reference #:include *.dll Console.WriteLine(Lib.LibClass.GetMessage()); """); @@ -1976,6 +1973,9 @@ public static class LibClass File.WriteAllText(Path.Join(srcDir, "Directory.Build.props"), $""" + + <{CSharpDirective.IncludeOrExclude.MappingPropertyName}> + @@ -2050,9 +2050,6 @@ public static class LibClass File.WriteAllText(Path.Join(srcDir, "Directory.Build.props"), $""" - - .dll=Reference - @@ -2121,7 +2118,6 @@ public static class LibClass var libDllProjectPath = Path.Join("Lib", "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "Lib.dll"); File.WriteAllText(Path.Join(testInstance.Path, "extra.cs"), $$""" - #:property FileBasedProgramsItemMapping=.dll=Reference #:include {{libDllDirectivePath}} """); @@ -2201,7 +2197,6 @@ public static class DependencyClass File.WriteAllText(Path.Join(libDir, "lib.cs"), $$""" #:property OutputType=Library - #:property FileBasedProgramsItemMapping=.dll=Reference #:include {{dependencyDllDirectivePath}} namespace MyLib; public static class Wrapper diff --git a/test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs b/test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs index e624178fe865..5d494bcdac97 100644 --- a/test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs +++ b/test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs @@ -1363,7 +1363,7 @@ public void Api() artifacts/$(AssemblyName) true {programPath} - .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content + .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content;.dll=Reference false true Exe @@ -1448,7 +1448,7 @@ public void Api_Evaluation() artifacts/$(AssemblyName) true {programPath} - .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content + .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content;.dll=Reference false true false @@ -1524,7 +1524,7 @@ public void Api_Diagnostic_01() artifacts/$(AssemblyName) true {programPath} - .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content + .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content;.dll=Reference false true false @@ -1599,7 +1599,7 @@ public void Api_Diagnostic_02() artifacts/$(AssemblyName) true {programPath} - .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content + .cs=Compile;.resx=EmbeddedResource;.json=None;.razor=Content;.dll=Reference false true false From 69f55b57ca2871549a461fd1147addd5d3ab9a62 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 08:50:56 +0000 Subject: [PATCH 7/7] Reset files to main Reset patterns: - global.json - NuGet.config - eng/Version.Details.xml - eng/Version.Details.props - eng/common/* --- NuGet.config | 2 + eng/Version.Details.props | 282 ++++--- eng/Version.Details.xml | 692 +++++++++--------- eng/common/AGENTS.md | 5 + eng/common/SetupNugetSources.ps1 | 17 +- eng/common/SetupNugetSources.sh | 17 +- eng/common/build.ps1 | 2 + eng/common/build.sh | 8 +- eng/common/core-templates/job/job.yml | 8 + eng/common/core-templates/job/onelocbuild.yml | 3 + .../job/publish-build-assets.yml | 12 +- eng/common/core-templates/job/renovate.yml | 196 +++++ .../job/source-index-stage1.yml | 6 +- .../post-build/common-variables.yml | 2 - .../core-templates/post-build/post-build.yml | 528 ++++++------- eng/common/core-templates/stages/renovate.yml | 111 +++ .../steps/install-microbuild-impl.yml | 34 + .../steps/install-microbuild.yml | 64 +- .../core-templates/steps/publish-logs.yml | 1 + .../core-templates/steps/source-build.yml | 2 +- .../steps/source-index-stage1-publish.yml | 8 +- eng/common/cross/build-rootfs.sh | 81 +- eng/common/cross/toolchain.cmake | 27 +- eng/common/darc-init.ps1 | 8 +- eng/common/darc-init.sh | 6 +- eng/common/dotnet-install.ps1 | 6 +- eng/common/dotnet-install.sh | 8 +- eng/common/dotnet.sh | 2 +- eng/common/internal-feed-operations.sh | 2 +- eng/common/native/init-distro-rid.sh | 2 + eng/common/native/install-dependencies.sh | 11 +- eng/common/post-build/redact-logs.ps1 | 7 +- eng/common/renovate.env | 42 ++ eng/common/sdk-task.ps1 | 17 +- eng/common/sdk-task.sh | 2 +- eng/common/template-guidance.md | 3 - eng/common/tools.ps1 | 222 +++--- eng/common/tools.sh | 129 +++- global.json | 12 +- 39 files changed, 1530 insertions(+), 1057 deletions(-) create mode 100644 eng/common/AGENTS.md create mode 100644 eng/common/core-templates/job/renovate.yml create mode 100644 eng/common/core-templates/stages/renovate.yml create mode 100644 eng/common/core-templates/steps/install-microbuild-impl.yml create mode 100644 eng/common/renovate.env diff --git a/NuGet.config b/NuGet.config index f3f728c95515..4e8eb7f42e2c 100644 --- a/NuGet.config +++ b/NuGet.config @@ -23,6 +23,8 @@ + + diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 9865bae02a27..b32d8f4a347a 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -8,145 +8,136 @@ This file should be imported by eng/Versions.props 2.1.0 - 10.0.6-servicing.26176.101 - 10.0.6-servicing.26176.101 - 10.0.6-servicing.26176.101 - 10.0.6-servicing.26176.101 - 10.0.6 - 10.0.6-servicing.26176.101 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6-servicing.26176.101 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6-servicing.26176.101 - 10.0.6 - 10.0.6-servicing.26176.101 - 10.0.6-servicing.26176.101 - 10.4.0-preview.26264.101 - 10.0.6 - 10.0.6 - 18.7.0-preview-26264-101 - 18.7.0-preview-26264-101 - 7.7.0-rc.26501 - 10.0.400-alpha.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 10.4.0-preview.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 2.0.0-preview.1.26176.101 - 2.2.6 - 10.0.0-beta.26264.101 - 10.0.0-beta.26264.101 - 10.0.0-beta.26264.101 - 10.0.0-beta.26264.101 - 10.0.0-beta.26264.101 - 10.0.0-beta.26264.101 - 10.0.6 - 10.0.6 - 10.0.6-servicing.26176.101 - 10.0.6-servicing.26176.101 - 10.0.0-beta.26264.101 - 10.0.0-beta.26264.101 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 15.2.400-servicing.26264.101 - 10.0.6 - 5.8.0-1.26264.101 - 5.8.0-1.26264.101 - 10.0.6-servicing.26176.101 - 10.0.6 - 10.0.6 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 10.0.0-preview.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 18.8.0-preview-26261-101 + 18.8.0-preview-26261-101 + 7.7.0-rc.26201 + 11.0.100-preview.5.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 10.0.0-preview.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 2.0.0-preview.1.26261.101 + 3.0.0-preview.5.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-beta.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 15.2.101-preview5.26261.101 + 11.0.0-preview.5.26261.101 + 5.7.0-1.26261.101 + 5.7.0-1.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 10.0.0-preview.7.25377.103 - 10.4.0-preview.26264.101 - 10.0.6-servicing.26176.101 - 18.7.0-release-26264-101 - 10.0.6 - 10.0.6-servicing.26176.101 - 10.0.400-alpha.26264.101 - 10.0.400-alpha.26264.101 - 10.0.400-alpha.26264.101 - 10.0.400-alpha.26264.101 - 10.0.400-alpha.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 10.0.400-preview.26264.101 - 18.7.0-release-26264-101 - 18.7.0-release-26264-101 - 3.2.6 - 10.0.6 - 10.0.6-servicing.26176.101 - 10.0.6 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 7.7.0-rc.26501 - 10.0.6 - 2.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 - 10.0.6 + 10.0.0-preview.26261.101 + 11.0.0-preview.5.26261.101 + 18.8.0-preview-26261-101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.100-preview.5.26261.101 + 11.0.100-preview.5.26261.101 + 11.0.100-preview.5.26261.101 + 11.0.100-preview.5.26261.101 + 11.0.100-preview.5.26261.101 + 18.8.0-preview-26261-101 + 18.8.0-preview-26261-101 + 3.3.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 7.7.0-rc.26201 + 11.0.0-preview.5.26261.101 + 3.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 + 11.0.0-preview.5.26261.101 - 2.1.0-preview.25571.1 - 4.1.0-preview.25571.1 + 2.3.0-preview.26257.2 + 4.3.0-preview.26257.2 @@ -193,7 +184,6 @@ This file should be imported by eng/Versions.props $(MicrosoftCodeAnalysisRazorToolingInternalPackageVersion) $(MicrosoftCodeAnalysisWorkspacesCommonPackageVersion) $(MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion) - $(MicrosoftCodeAnalysisWorkspacesMSBuildBuildHostPackageVersion) $(MicrosoftDeploymentDotNetReleasesPackageVersion) $(MicrosoftDiaSymReaderPackageVersion) $(MicrosoftDotNetArcadeSdkPackageVersion) @@ -202,12 +192,13 @@ This file should be imported by eng/Versions.props $(MicrosoftDotNetBuildTasksWorkloadsPackageVersion) $(MicrosoftDotNetHelixSdkPackageVersion) $(MicrosoftDotNetSignToolPackageVersion) - $(MicrosoftDotNetWebItemTemplates100PackageVersion) - $(MicrosoftDotNetWebProjectTemplates100PackageVersion) + $(MicrosoftDotNetWebItemTemplates110PackageVersion) + $(MicrosoftDotNetWebProjectTemplates110PackageVersion) + $(MicrosoftMcpServerProjectTemplates110PackageVersion) $(MicrosoftDotnetWinFormsProjectTemplatesPackageVersion) $(MicrosoftDotNetWpfProjectTemplatesPackageVersion) $(MicrosoftDotNetXliffTasksPackageVersion) - $(MicrosoftDotNetXUnitExtensionsPackageVersion) + $(MicrosoftDotNetXUnitV3ExtensionsPackageVersion) $(MicrosoftExtensionsConfigurationIniPackageVersion) $(MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion) $(MicrosoftExtensionsDependencyModelPackageVersion) @@ -236,15 +227,6 @@ This file should be imported by eng/Versions.props $(MicrosoftSourceLinkCommonPackageVersion) $(MicrosoftSourceLinkGitHubPackageVersion) $(MicrosoftSourceLinkGitLabPackageVersion) - $(MicrosoftTemplateEngineAbstractionsPackageVersion) - $(MicrosoftTemplateEngineAuthoringTemplateVerifierPackageVersion) - $(MicrosoftTemplateEngineEdgePackageVersion) - $(MicrosoftTemplateEngineMocksPackageVersion) - $(MicrosoftTemplateEngineOrchestratorRunnableProjectsPackageVersion) - $(MicrosoftTemplateEngineTestHelperPackageVersion) - $(MicrosoftTemplateEngineUtilsPackageVersion) - $(MicrosoftTemplateSearchCommonPackageVersion) - $(MicrosoftTemplateSearchTemplateDiscoveryPackageVersion) $(MicrosoftTestPlatformBuildPackageVersion) $(MicrosoftTestPlatformCLIPackageVersion) $(MicrosoftWebXdtPackageVersion) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ec2f674decfd..5f9d5d2a36ba 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,62 +1,26 @@ - + - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 - - - https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 - - - https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 - - - https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 - - - https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + 547c640d5626b2976499cb3433abc741a63d67c5 @@ -68,174 +32,174 @@ https://github.com/dotnet/dotnet 6a953e76162f3f079405f80e28664fa51b136740 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 + + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 + + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/dotnet/dotnet - d1c618b916b548d50092bda48bdc1e74501ce0f7 + 547c640d5626b2976499cb3433abc741a63d67c5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 - + https://github.com/microsoft/testfx - 43e592148ac1c7916908477bdffcf2a345affa6d + e2ee36095962594765fcac54554e6957073076bf - + https://github.com/microsoft/testfx - 43e592148ac1c7916908477bdffcf2a345affa6d + e2ee36095962594765fcac54554e6957073076bf - - https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet - 47fb725acf5d7094af51aebbb5b7e5c44a3b2a77 + + https://github.com/dotnet/dotnet + 547c640d5626b2976499cb3433abc741a63d67c5 diff --git a/eng/common/AGENTS.md b/eng/common/AGENTS.md new file mode 100644 index 000000000000..a5ed8f72926d --- /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/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1 index 65ed3a8adef0..fc8d618014e0 100644 --- a/eng/common/SetupNugetSources.ps1 +++ b/eng/common/SetupNugetSources.ps1 @@ -1,7 +1,6 @@ # This script adds internal feeds required to build commits that depend on internal package sources. For instance, -# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. Similarly, -# dotnet-eng-internal and dotnet-tools-internal are added if dotnet-eng and dotnet-tools are present. -# In addition, this script also enables disabled internal Maestro (darc-int*) feeds. +# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables +# disabled internal Maestro (darc-int*) feeds. # # Optionally, this script also adds a credential entry for each of the internal feeds if supplied. # @@ -174,16 +173,4 @@ foreach ($dotnetVersion in $dotnetVersions) { } } -# Check for dotnet-eng and add dotnet-eng-internal if present -$dotnetEngSource = $sources.SelectSingleNode("add[@key='dotnet-eng']") -if ($dotnetEngSource -ne $null) { - AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-eng-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-eng-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password -} - -# Check for dotnet-tools and add dotnet-tools-internal if present -$dotnetToolsSource = $sources.SelectSingleNode("add[@key='dotnet-tools']") -if ($dotnetToolsSource -ne $null) { - AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-tools-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password -} - $doc.Save($filename) diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh index b2163abbe71b..b97cc536379d 100755 --- a/eng/common/SetupNugetSources.sh +++ b/eng/common/SetupNugetSources.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash # This script adds internal feeds required to build commits that depend on internal package sources. For instance, -# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. Similarly, -# dotnet-eng-internal and dotnet-tools-internal are added if dotnet-eng and dotnet-tools are present. -# In addition, this script also enables disabled internal Maestro (darc-int*) feeds. +# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables +# disabled internal Maestro (darc-int*) feeds. # # Optionally, this script also adds a credential entry for each of the internal feeds if supplied. # @@ -174,18 +173,6 @@ for DotNetVersion in ${DotNetVersions[@]} ; do fi done -# Check for dotnet-eng and add dotnet-eng-internal if present -grep -i " /dev/null -if [ "$?" == "0" ]; then - AddOrEnablePackageSource "dotnet-eng-internal" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-eng-internal/nuget/$FeedSuffix" -fi - -# Check for dotnet-tools and add dotnet-tools-internal if present -grep -i " /dev/null -if [ "$?" == "0" ]; then - AddOrEnablePackageSource "dotnet-tools-internal" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/$FeedSuffix" -fi - # I want things split line by line PrevIFS=$IFS IFS=$'\n' diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index 8cfee107e7a3..18397a60eb85 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -6,6 +6,7 @@ Param( [string][Alias('v')]$verbosity = "minimal", [string] $msbuildEngine = $null, [bool] $warnAsError = $true, + [string] $warnNotAsError = '', [bool] $nodeReuse = $true, [switch] $buildCheck = $false, [switch][Alias('r')]$restore, @@ -70,6 +71,7 @@ function Print-Usage() { Write-Host " -excludeCIBinarylog Don't output binary log (short: -nobl)" Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" Write-Host " -warnAsError Sets warnaserror msbuild parameter ('true' or 'false')" + Write-Host " -warnNotAsError Sets a semi-colon delimited list of warning codes that should not be treated as errors" Write-Host " -msbuildEngine Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." Write-Host " -excludePrereleaseVS Set to exclude build engines in prerelease versions of Visual Studio" Write-Host " -nativeToolsOnMachine Sets the native tools on machine environment variable (indicating that the script should use native tools on machine)" diff --git a/eng/common/build.sh b/eng/common/build.sh index 9767bb411a4f..5883e53bcfb1 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -42,6 +42,7 @@ usage() echo " --prepareMachine Prepare machine for CI run, clean up processes after build" echo " --nodeReuse Sets nodereuse msbuild parameter ('true' or 'false')" echo " --warnAsError Sets warnaserror msbuild parameter ('true' or 'false')" + echo " --warnNotAsError Sets a semi-colon delimited list of warning codes that should not be treated as errors" echo " --buildCheck Sets /check msbuild parameter" echo " --fromVMR Set when building from within the VMR" echo "" @@ -78,6 +79,7 @@ ci=false clean=false warn_as_error=true +warn_not_as_error='' node_reuse=true build_check=false binary_log=false @@ -92,7 +94,7 @@ runtime_source_feed='' runtime_source_feed_key='' properties=() -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" case "$opt" in -help|-h) @@ -176,6 +178,10 @@ while [[ $# > 0 ]]; do warn_as_error=$2 shift ;; + -warnnotaserror) + warn_not_as_error=$2 + shift + ;; -nodereuse) node_reuse=$2 shift diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml index eaed6d87e653..66c7988f222a 100644 --- a/eng/common/core-templates/job/job.yml +++ b/eng/common/core-templates/job/job.yml @@ -19,6 +19,8 @@ parameters: # publishing defaults artifacts: '' enableMicrobuild: false + enablePreviewMicrobuild: false + microbuildPluginVersion: 'latest' enableMicrobuildForMacAndLinux: false microbuildUseESRP: true enablePublishBuildArtifacts: false @@ -71,6 +73,8 @@ jobs: templateContext: ${{ parameters.templateContext }} variables: + - name: AllowPtrToDetectTestRunRetryFiles + value: true - ${{ if ne(parameters.enableTelemetry, 'false') }}: - name: DOTNET_CLI_TELEMETRY_PROFILE value: '$(Build.Repository.Uri)' @@ -128,6 +132,8 @@ jobs: - template: /eng/common/core-templates/steps/install-microbuild.yml parameters: enableMicrobuild: ${{ parameters.enableMicrobuild }} + enablePreviewMicrobuild: ${{ parameters.enablePreviewMicrobuild }} + microbuildPluginVersion: ${{ parameters.microbuildPluginVersion }} enableMicrobuildForMacAndLinux: ${{ parameters.enableMicrobuildForMacAndLinux }} microbuildUseESRP: ${{ parameters.microbuildUseESRP }} continueOnError: ${{ parameters.continueOnError }} @@ -150,6 +156,8 @@ jobs: - template: /eng/common/core-templates/steps/cleanup-microbuild.yml parameters: enableMicrobuild: ${{ parameters.enableMicrobuild }} + enablePreviewMicrobuild: ${{ parameters.enablePreviewMicrobuild }} + microbuildPluginVersion: ${{ parameters.microbuildPluginVersion }} enableMicrobuildForMacAndLinux: ${{ parameters.enableMicrobuildForMacAndLinux }} continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/core-templates/job/onelocbuild.yml b/eng/common/core-templates/job/onelocbuild.yml index eefed3b667a4..86ea9f635042 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/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index 06f2eed0323d..700f77114658 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -91,8 +91,8 @@ jobs: fetchDepth: 3 clean: true - - ${{ if eq(parameters.isAssetlessBuild, 'false') }}: - - ${{ if eq(parameters.publishingVersion, 3) }}: + - ${{ if eq(parameters.isAssetlessBuild, 'false') }}: + - ${{ if eq(parameters.publishingVersion, 3) }}: - task: DownloadPipelineArtifact@2 displayName: Download Asset Manifests inputs: @@ -117,7 +117,7 @@ jobs: flattenFolders: true condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - + - task: NuGetAuthenticate@1 # Populate internal runtime variables. @@ -125,7 +125,7 @@ jobs: ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: parameters: legacyCredential: $(dn-bot-dnceng-artifact-feeds-rw) - + - template: /eng/common/templates/steps/enable-internal-runtimes.yml - task: AzureCLI@2 @@ -145,7 +145,7 @@ jobs: condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - + - task: powershell@2 displayName: Create ReleaseConfigs Artifact inputs: @@ -191,7 +191,7 @@ jobs: BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - + # Darc is targeting 8.0, so make sure it's installed - task: UseDotNet@2 inputs: diff --git a/eng/common/core-templates/job/renovate.yml b/eng/common/core-templates/job/renovate.yml new file mode 100644 index 000000000000..ff86c80b4689 --- /dev/null +++ b/eng/common/core-templates/job/renovate.yml @@ -0,0 +1,196 @@ +# -------------------------------------------------------------------------------------- +# Renovate Bot Job Template +# -------------------------------------------------------------------------------------- +# This Azure DevOps pipeline job template runs Renovate (https://docs.renovatebot.com/) +# to automatically update dependencies in a GitHub repository. +# +# Renovate scans the repository for dependency files and creates pull requests to update +# outdated dependencies based on the configuration specified in the renovateConfigPath +# parameter. +# +# Usage: +# For each product repo wanting to make use of Renovate, this template is called from +# an internal Azure DevOps pipeline, typically with a schedule trigger, to check for +# and propose dependency updates. +# +# For more info, see https://github.com/dotnet/arcade/blob/main/Documentation/Renovate.md +# -------------------------------------------------------------------------------------- + +parameters: + +# Path to the Renovate configuration file within the repository. +- name: renovateConfigPath + type: string + default: 'eng/renovate.json' + +# GitHub repository to run Renovate against, in the format 'owner/repo'. +# This could technically be any repo but convention is to target the same +# repo that contains the calling pipeline. The Renovate config file would +# be co-located with the pipeline's repo and, in most cases, the config +# file is specific to the repo being targeted. +- name: gitHubRepo + type: string + +# List of base branches to target for Renovate PRs. +# NOTE: The Renovate configuration file is always read from the branch where the +# pipeline is run, NOT from the target branches specified here. If you need different +# configurations for different branches, run the pipeline from each branch separately. +- name: baseBranches + type: object + default: + - main + +# When true, Renovate will run in dry run mode, which previews changes without creating PRs. +# See the 'Run Renovate' step log output for details of what would have been changed. +- name: dryRun + type: boolean + default: false + +# By default, Renovate will not recreate a PR for a given dependency/version pair that was +# previously closed. This allows opting in to always recreating PRs even if they were +# previously closed. +- name: forceRecreatePR + type: boolean + default: false + +# Name of the arcade repository resource in the pipeline. +# This allows repos which haven't been onboarded to Arcade to still use this +# template by checking out the repo as a resource with a custom name and pointing +# this parameter to it. +- name: arcadeRepoResource + type: string + default: self + +# Directory name for the self repo under $(Build.SourcesDirectory) in multi-checkout. +# In multi-checkout (when arcadeRepoResource != 'self'), Azure DevOps checks out the +# self repo to $(Build.SourcesDirectory)/. Set this to match the auto-generated +# directory name. Using the auto-generated name is necessary rather than explicitly +# defining a checkout path because container jobs expect repos to live under the agent's +# workspace ($(Pipeline.Workspace)). On some self-hosted setups the host path +# (e.g., /mnt/vss/_work) differs from the container path (e.g., /__w), and a custom checkout +# path can fail validation. Using the default checkout location keeps the paths consistent +# and avoids this issue. +- name: selfRepoName + type: string + default: '' +- name: arcadeRepoName + type: string + default: '' + +# Pool configuration for the job. +- name: pool + type: object + default: + name: NetCore1ESPool-Internal + image: build.azurelinux.3.amd64 + os: linux + +jobs: +- job: Renovate + displayName: Run Renovate + container: RenovateContainer + variables: + - group: dotnet-renovate-bot + # The Renovate version is automatically updated by https://github.com/dotnet/arcade/blob/main/azure-pipelines-renovate.yml. + # Changing the variable name here would require updating the name in https://github.com/dotnet/arcade/blob/main/eng/renovate.json as well. + - name: renovateVersion + value: '42' + readonly: true + - name: renovateLogFilePath + value: '$(Build.ArtifactStagingDirectory)/renovate.json' + readonly: true + - name: dryRunArg + readonly: true + ${{ if eq(parameters.dryRun, true) }}: + value: 'full' + ${{ else }}: + value: '' + - name: recreateWhenArg + readonly: true + ${{ if eq(parameters.forceRecreatePR, true) }}: + value: 'always' + ${{ else }}: + value: '' + # In multi-checkout (without custom paths), Azure DevOps places each repo under + # $(Build.SourcesDirectory)/. selfRepoName must be provided in that case. + - name: selfRepoPath + readonly: true + ${{ if eq(parameters.arcadeRepoResource, 'self') }}: + value: '$(Build.SourcesDirectory)' + ${{ else }}: + value: '$(Build.SourcesDirectory)/${{ parameters.selfRepoName }}' + - name: arcadeRepoPath + readonly: true + ${{ if eq(parameters.arcadeRepoResource, 'self') }}: + value: '$(Build.SourcesDirectory)' + ${{ else }}: + value: '$(Build.SourcesDirectory)/${{ parameters.arcadeRepoName }}' + pool: ${{ parameters.pool }} + + templateContext: + outputParentDirectory: $(Build.ArtifactStagingDirectory) + outputs: + - output: pipelineArtifact + displayName: Publish Renovate Log + condition: succeededOrFailed() + targetPath: $(Build.ArtifactStagingDirectory) + artifactName: $(Agent.JobName)_Logs_Attempt$(System.JobAttempt) + isProduction: false # logs are non-production artifacts + + steps: + - checkout: self + fetchDepth: 1 + + - ${{ if ne(parameters.arcadeRepoResource, 'self') }}: + - checkout: ${{ parameters.arcadeRepoResource }} + fetchDepth: 1 + + - script: | + renovate-config-validator $(selfRepoPath)/${{parameters.renovateConfigPath}} 2>&1 | tee /tmp/renovate-config-validator.out + validatorExit=${PIPESTATUS[0]} + if grep -q '^ WARN:' /tmp/renovate-config-validator.out; then + echo "##vso[task.logissue type=warning]Renovate config validator produced warnings." + echo "##vso[task.complete result=SucceededWithIssues]" + fi + exit $validatorExit + displayName: Validate Renovate config + env: + LOG_LEVEL: info + LOG_FILE_LEVEL: debug + LOG_FILE: $(Build.ArtifactStagingDirectory)/renovate-config-validator.json + + - script: | + . $(arcadeRepoPath)/eng/common/renovate.env + renovate 2>&1 | tee /tmp/renovate.out + renovateExit=${PIPESTATUS[0]} + if grep -q '^ WARN:' /tmp/renovate.out; then + echo "##vso[task.logissue type=warning]Renovate produced warnings." + echo "##vso[task.complete result=SucceededWithIssues]" + fi + exit $renovateExit + displayName: Run Renovate + env: + RENOVATE_FORK_TOKEN: $(BotAccount-dotnet-renovate-bot-PAT) + RENOVATE_TOKEN: $(BotAccount-dotnet-renovate-bot-PAT) + RENOVATE_REPOSITORIES: ${{parameters.gitHubRepo}} + RENOVATE_BASE_BRANCHES: ${{ convertToJson(parameters.baseBranches) }} + RENOVATE_DRY_RUN: $(dryRunArg) + RENOVATE_RECREATE_WHEN: $(recreateWhenArg) + LOG_LEVEL: info + LOG_FILE_LEVEL: debug + LOG_FILE: $(renovateLogFilePath) + RENOVATE_CONFIG_FILE: $(selfRepoPath)/${{parameters.renovateConfigPath}} + + - script: | + echo "PRs created by Renovate:" + if [ -s "$(renovateLogFilePath)" ]; then + if ! jq -r 'select(.msg == "PR created" and .pr != null) | "https://github.com/\(.repository)/pull/\(.pr)"' "$(renovateLogFilePath)" | sort -u; then + echo "##vso[task.logissue type=warning]Failed to parse Renovate log file with jq." + echo "##vso[task.complete result=SucceededWithIssues]" + fi + else + echo "##vso[task.logissue type=warning]No Renovate log file found or file is empty." + echo "##vso[task.complete result=SucceededWithIssues]" + fi + displayName: List created PRs + condition: and(succeededOrFailed(), eq('${{ parameters.dryRun }}', false)) diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml index 76baf5c27258..bac6ac5faac3 100644 --- a/eng/common/core-templates/job/source-index-stage1.yml +++ b/eng/common/core-templates/job/source-index-stage1.yml @@ -15,6 +15,8 @@ jobs: variables: - name: BinlogPath value: ${{ parameters.binlogPath }} + - name: skipComponentGovernanceDetection + value: true - template: /eng/common/core-templates/variables/pool-providers.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} @@ -25,10 +27,10 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - image: windows.vs2026preview.scout.amd64.open + image: windows.vs2026.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) - image: windows.vs2026preview.scout.amd64 + image: windows.vs2026.amd64 steps: - ${{ if eq(parameters.is1ESPipeline, '') }}: diff --git a/eng/common/core-templates/post-build/common-variables.yml b/eng/common/core-templates/post-build/common-variables.yml index d5627a994ae5..db298ae16bae 100644 --- a/eng/common/core-templates/post-build/common-variables.yml +++ b/eng/common/core-templates/post-build/common-variables.yml @@ -11,8 +11,6 @@ variables: - name: MaestroApiVersion value: "2020-02-20" - - name: SourceLinkCLIVersion - value: 3.0.0 - name: SymbolToolVersion value: 1.0.1 - name: BinlogToolVersion diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index 905a6315e2d5..8aa86e304919 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -1,118 +1,108 @@ parameters: - # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. - # Publishing V1 is no longer supported - # Publishing V2 is no longer supported - # Publishing V3 is the default - - name: publishingInfraVersion - displayName: Which version of publishing should be used to promote the build definition? - type: number - default: 3 - values: - - 3 - - 4 - - - name: BARBuildId - displayName: BAR Build Id - type: number - default: 0 - - - name: PromoteToChannelIds - displayName: Channel to promote BARBuildId to - type: string - default: '' - - - name: enableSourceLinkValidation - displayName: Enable SourceLink validation - type: boolean - default: false - - - name: enableSigningValidation - displayName: Enable signing validation - type: boolean - default: true - - - name: enableSymbolValidation - displayName: Enable symbol validation - type: boolean - default: false - - - name: enableNugetValidation - displayName: Enable NuGet validation - type: boolean - default: true - - - name: publishInstallersAndChecksums - displayName: Publish installers and checksums - type: boolean - default: true - - - name: requireDefaultChannels - displayName: Fail the build if there are no default channel(s) registrations for the current build - type: boolean - default: false - - - name: SDLValidationParameters - type: object - default: - enable: false - publishGdn: false - continueOnError: false - params: '' - artifactNames: '' - downloadArtifacts: true - - - name: isAssetlessBuild - type: boolean - displayName: Is Assetless Build - default: false - - # These parameters let the user customize the call to sdk-task.ps1 for publishing - # symbols & general artifacts as well as for signing validation - - name: symbolPublishingAdditionalParameters - displayName: Symbol publishing additional parameters - type: string - default: '' - - - name: artifactsPublishingAdditionalParameters - displayName: Artifact publishing additional parameters - type: string - default: '' - - - name: signingValidationAdditionalParameters - displayName: Signing validation additional parameters - type: string - default: '' - - # Which stages should finish execution before post-build stages start - - name: validateDependsOn - type: object - default: - - build - - - name: publishDependsOn - type: object - default: - - Validate - - # Optional: Call asset publishing rather than running in a separate stage - - name: publishAssetsImmediately - type: boolean - default: false - - - name: is1ESPipeline - type: boolean - default: false +# Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. +# Publishing V1 is no longer supported +# Publishing V2 is no longer supported +# Publishing V3 is the default +- name: publishingInfraVersion + displayName: Which version of publishing should be used to promote the build definition? + type: number + default: 3 + values: + - 3 + - 4 + +- name: BARBuildId + displayName: BAR Build Id + type: number + default: 0 + +- name: PromoteToChannelIds + displayName: Channel to promote BARBuildId to + type: string + default: '' + +- name: enableSourceLinkValidation + displayName: Enable SourceLink validation + type: boolean + default: false + +- name: enableSigningValidation + displayName: Enable signing validation + type: boolean + default: true + +- name: enableSymbolValidation + displayName: Enable symbol validation + type: boolean + default: false + +- name: enableNugetValidation + displayName: Enable NuGet validation + type: boolean + default: true + +- name: publishInstallersAndChecksums + displayName: Publish installers and checksums + type: boolean + default: true + +- name: requireDefaultChannels + displayName: Fail the build if there are no default channel(s) registrations for the current build + type: boolean + default: false + +- name: isAssetlessBuild + type: boolean + displayName: Is Assetless Build + default: false + +# These parameters let the user customize the call to sdk-task.ps1 for publishing +# symbols & general artifacts as well as for signing validation +- name: symbolPublishingAdditionalParameters + displayName: Symbol publishing additional parameters + type: string + default: '' + +- name: artifactsPublishingAdditionalParameters + displayName: Artifact publishing additional parameters + type: string + default: '' + +- name: signingValidationAdditionalParameters + displayName: Signing validation additional parameters + type: string + default: '' + +# Which stages should finish execution before post-build stages start +- name: validateDependsOn + type: object + default: + - build + +- name: publishDependsOn + type: object + default: + - Validate + +# Optional: Call asset publishing rather than running in a separate stage +- name: publishAssetsImmediately + type: boolean + default: false + +- name: is1ESPipeline + type: boolean + default: false stages: -- ${{ if or(eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: +- ${{ if or(eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true')) }}: - stage: Validate dependsOn: ${{ parameters.validateDependsOn }} displayName: Validate Build Assets variables: - - template: /eng/common/core-templates/post-build/common-variables.yml - - template: /eng/common/core-templates/variables/pool-providers.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} + - template: /eng/common/core-templates/post-build/common-variables.yml + - template: /eng/common/core-templates/variables/pool-providers.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} jobs: - job: displayName: NuGet Validation @@ -128,49 +118,49 @@ stages: ${{ else }}: ${{ if eq(parameters.is1ESPipeline, true) }}: name: $(DncEngInternalBuildPool) - image: windows.vs2026preview.scout.amd64 + image: windows.vs2026.amd64 os: windows ${{ else }}: name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2026preview.scout.amd64 + demands: ImageOverride -equals windows.vs2026.amd64 steps: - - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - is1ESPipeline: ${{ parameters.is1ESPipeline }} - - - ${{ if ne(parameters.publishingInfraVersion, 4) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - - ${{ if eq(parameters.publishingInfraVersion, 4) }}: - - task: DownloadPipelineArtifact@2 - displayName: Download Pipeline Artifacts (V4) - inputs: - itemPattern: '*/packages/**/*.nupkg' - targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' - - task: CopyFiles@2 - displayName: Flatten packages to PackageArtifacts - inputs: - SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' - Contents: '**/*.nupkg' - TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' - flattenFolders: true - - - task: PowerShell@2 - displayName: Validate + - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} + is1ESPipeline: ${{ parameters.is1ESPipeline }} + + - ${{ if ne(parameters.publishingInfraVersion, 4) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: specific + buildVersionToDownload: specific + project: $(AzDOProjectName) + pipeline: $(AzDOPipelineId) + buildId: $(AzDOBuildId) + artifactName: PackageArtifacts + checkDownloadedFiles: true + - ${{ if eq(parameters.publishingInfraVersion, 4) }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifacts (V4) + inputs: + itemPattern: '*/packages/**/*.nupkg' + targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + - task: CopyFiles@2 + displayName: Flatten packages to PackageArtifacts inputs: - filePath: $(System.DefaultWorkingDirectory)/eng/common/post-build/nuget-validation.ps1 - arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ + SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + Contents: '**/*.nupkg' + TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' + flattenFolders: true + + - task: PowerShell@2 + displayName: Validate + inputs: + filePath: $(System.DefaultWorkingDirectory)/eng/common/post-build/nuget-validation.ps1 + arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ - job: displayName: Signing Validation @@ -184,143 +174,96 @@ stages: os: windows # If it's not devdiv, it's dnceng ${{ else }}: - ${{ if eq(parameters.is1ESPipeline, true) }}: + ${{ if eq(parameters.is1ESPipeline, true) }}: name: $(DncEngInternalBuildPool) image: windows.vs2026.amd64 os: windows ${{ else }}: name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2026preview.scout.amd64 + demands: ImageOverride -equals windows.vs2026.amd64 steps: - - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - is1ESPipeline: ${{ parameters.is1ESPipeline }} - - - ${{ if ne(parameters.publishingInfraVersion, 4) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - - ${{ if eq(parameters.publishingInfraVersion, 4) }}: - - task: DownloadPipelineArtifact@2 - displayName: Download Pipeline Artifacts (V4) - inputs: - itemPattern: '*/packages/**/*.nupkg' - targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' - - task: CopyFiles@2 - displayName: Flatten packages to PackageArtifacts - inputs: - SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' - Contents: '**/*.nupkg' - TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' - flattenFolders: true - - # This is necessary whenever we want to publish/restore to an AzDO private feed - # Since sdk-task.ps1 tries to restore packages we need to do this authentication here - # otherwise it'll complain about accessing a private feed. - - task: NuGetAuthenticate@1 - displayName: 'Authenticate to AzDO Feeds' - - # Signing validation will optionally work with the buildmanifest file which is downloaded from - # Azure DevOps above. - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task SigningValidation -restore -msbuildEngine vs - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' - /p:SignCheckExclusionsFile='$(System.DefaultWorkingDirectory)/eng/SignCheckExclusionsFile.txt' - ${{ parameters.signingValidationAdditionalParameters }} - - - template: /eng/common/core-templates/steps/publish-logs.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - StageLabel: 'Validation' - JobLabel: 'Signing' - BinlogToolVersion: $(BinlogToolVersion) + - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} + is1ESPipeline: ${{ parameters.is1ESPipeline }} - - job: - displayName: SourceLink Validation - condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2025 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - ${{ if eq(parameters.is1ESPipeline, true) }}: - name: $(DncEngInternalBuildPool) - image: windows.vs2026.amd64 - os: windows - ${{ else }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2026preview.scout.amd64 - steps: - - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - is1ESPipeline: ${{ parameters.is1ESPipeline }} - - - ${{ if ne(parameters.publishingInfraVersion, 4) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: BlobArtifacts - checkDownloadedFiles: true - - ${{ if eq(parameters.publishingInfraVersion, 4) }}: - - task: DownloadPipelineArtifact@2 - displayName: Download Pipeline Artifacts (V4) - inputs: - itemPattern: '*/assets/**' - targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' - - task: CopyFiles@2 - displayName: Flatten assets to BlobArtifacts - inputs: - SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' - Contents: '**/*' - TargetFolder: '$(Build.ArtifactStagingDirectory)/BlobArtifacts' - flattenFolders: true - - - task: PowerShell@2 - displayName: Validate + - ${{ if ne(parameters.publishingInfraVersion, 4) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: specific + buildVersionToDownload: specific + project: $(AzDOProjectName) + pipeline: $(AzDOPipelineId) + buildId: $(AzDOBuildId) + artifactName: PackageArtifacts + checkDownloadedFiles: true + - ${{ if eq(parameters.publishingInfraVersion, 4) }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Pipeline Artifacts (V4) + inputs: + itemPattern: '*/packages/**/*.nupkg' + targetPath: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + - task: CopyFiles@2 + displayName: Flatten packages to PackageArtifacts + inputs: + SourceFolder: '$(Build.ArtifactStagingDirectory)/PipelineArtifactsDownload' + Contents: '**/*.nupkg' + TargetFolder: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' + flattenFolders: true + + # This is necessary whenever we want to publish/restore to an AzDO private feed + # Since sdk-task.ps1 tries to restore packages we need to do this authentication here + # otherwise it'll complain about accessing a private feed. + - task: NuGetAuthenticate@1 + displayName: 'Authenticate to AzDO Feeds' + + # Signing validation will optionally work with the buildmanifest file which is downloaded from + # Azure DevOps above. + - task: PowerShell@2 + displayName: Validate + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task SigningValidation -restore -msbuildEngine dotnet + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' + /p:SignCheckExclusionsFile='$(System.DefaultWorkingDirectory)/eng/SignCheckExclusionsFile.txt' + ${{ parameters.signingValidationAdditionalParameters }} + + - template: /eng/common/core-templates/steps/publish-logs.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + StageLabel: 'Validation' + JobLabel: 'Signing' + BinlogToolVersion: $(BinlogToolVersion) + + # SourceLink validation has been removed — the underlying CLI tool + # (targeting netcoreapp2.1) has not functioned for years. + # The enableSourceLinkValidation parameter is kept but ignored so + # existing pipelines that pass it are not broken. + # See https://github.com/dotnet/arcade/issues/16647 + - ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}: + - job: + displayName: 'SourceLink Validation Removed - please remove enableSourceLinkValidation from your pipeline' + pool: server + steps: + - task: Delay@1 + displayName: 'Warning: SourceLink validation removed (see https://github.com/dotnet/arcade/issues/16647)' inputs: - filePath: $(System.DefaultWorkingDirectory)/eng/common/post-build/sourcelink-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -ExtractPath $(Agent.BuildDirectory)/Extract/ - -GHRepoName $(Build.Repository.Name) - -GHCommit $(Build.SourceVersion) - -SourcelinkCliVersion $(SourceLinkCLIVersion) - continueOnError: true + delayForMinutes: '0' - ${{ if ne(parameters.publishAssetsImmediately, 'true') }}: - stage: publish_using_darc - ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: + ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true')) }}: dependsOn: ${{ parameters.publishDependsOn }} ${{ else }}: dependsOn: ${{ parameters.validateDependsOn }} displayName: Publish using Darc variables: - - template: /eng/common/core-templates/post-build/common-variables.yml - - template: /eng/common/core-templates/variables/pool-providers.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} + - template: /eng/common/core-templates/post-build/common-variables.yml + - template: /eng/common/core-templates/variables/pool-providers.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} jobs: - job: displayName: Publish Using Darc @@ -334,7 +277,7 @@ stages: os: windows # If it's not devdiv, it's dnceng ${{ else }}: - ${{ if eq(parameters.is1ESPipeline, true) }}: + ${{ if eq(parameters.is1ESPipeline, true) }}: name: NetCore1ESPool-Publishing-Internal image: windows.vs2026.amd64 os: windows @@ -342,34 +285,33 @@ stages: name: NetCore1ESPool-Publishing-Internal demands: ImageOverride -equals windows.vs2026.amd64 steps: - - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - is1ESPipeline: ${{ parameters.is1ESPipeline }} - - - task: NuGetAuthenticate@1 - - # Populate internal runtime variables. - - template: /eng/common/templates/steps/enable-internal-sources.yml - parameters: - legacyCredential: $(dn-bot-dnceng-artifact-feeds-rw) - - - template: /eng/common/templates/steps/enable-internal-runtimes.yml + - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} + is1ESPipeline: ${{ parameters.is1ESPipeline }} - # Darc is targeting 8.0, so make sure it's installed - - task: UseDotNet@2 - inputs: - version: 8.0.x + - task: NuGetAuthenticate@1 - - task: AzureCLI@2 - displayName: Publish Using Darc - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(System.DefaultWorkingDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: > + # Populate internal runtime variables. + - template: /eng/common/templates/steps/enable-internal-sources.yml + parameters: + legacyCredential: $(dn-bot-dnceng-artifact-feeds-rw) + + - template: /eng/common/templates/steps/enable-internal-runtimes.yml + + - task: UseDotNet@2 + inputs: + version: 8.0.x + + - task: AzureCLI@2 + displayName: Publish Using Darc + inputs: + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(System.DefaultWorkingDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: > -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(System.AccessToken)' diff --git a/eng/common/core-templates/stages/renovate.yml b/eng/common/core-templates/stages/renovate.yml new file mode 100644 index 000000000000..edab28182585 --- /dev/null +++ b/eng/common/core-templates/stages/renovate.yml @@ -0,0 +1,111 @@ +# -------------------------------------------------------------------------------------- +# Renovate Pipeline Template +# -------------------------------------------------------------------------------------- +# This template provides a complete reusable pipeline definition for running Renovate +# in a 1ES Official pipeline. Pipelines can extend from this template and only need +# to pass the Renovate job parameters. +# +# For more info, see https://github.com/dotnet/arcade/blob/main/Documentation/Renovate.md +# -------------------------------------------------------------------------------------- + +parameters: + +# Path to the Renovate configuration file within the repository. +- name: renovateConfigPath + type: string + default: 'eng/renovate.json' + +# GitHub repository to run Renovate against, in the format 'owner/repo'. +- name: gitHubRepo + type: string + +# List of base branches to target for Renovate PRs. +- name: baseBranches + type: object + default: + - main + +# When true, Renovate will run in dry run mode. +- name: dryRun + type: boolean + default: false + +# When true, Renovate will recreate PRs even if they were previously closed. +- name: forceRecreatePR + type: boolean + default: false + +# Name of the arcade repository resource in the pipeline. +# This allows repos which haven't been onboarded to Arcade to still use this +# template by checking out the repo as a resource with a custom name and pointing +# this parameter to it. +- name: arcadeRepoResource + type: string + default: 'self' + +- name: selfRepoName + type: string + default: '' +- name: arcadeRepoName + type: string + default: '' + +# Pool configuration for the pipeline. +- name: pool + type: object + default: + name: NetCore1ESPool-Internal + image: build.azurelinux.3.amd64 + os: linux + +# Renovate version used in the container image tag. +- name: renovateVersion + default: 43 + type: number + +# Pool configuration for SDL analysis. +- name: sdlPool + type: object + default: + name: NetCore1ESPool-Internal + image: windows.vs2026.amd64 + os: windows + +resources: + repositories: + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + +extends: + template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates + parameters: + pool: ${{ parameters.pool }} + sdl: + sourceAnalysisPool: ${{ parameters.sdlPool }} + # When repos that aren't onboarded to Arcade use this template, they set the + # arcadeRepoResource parameter to point to their Arcade repo resource. In that case, + # Aracde will be excluded from SDL analysis. + ${{ if ne(parameters.arcadeRepoResource, 'self') }}: + sourceRepositoriesToScan: + exclude: + - repository: ${{ parameters.arcadeRepoResource }} + containers: + RenovateContainer: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-renovate-${{ parameters.renovateVersion }}-amd64 + stages: + - stage: Renovate + displayName: Run Renovate + jobs: + - template: /eng/common/core-templates/job/renovate.yml@${{ parameters.arcadeRepoResource }} + parameters: + renovateConfigPath: ${{ parameters.renovateConfigPath }} + gitHubRepo: ${{ parameters.gitHubRepo }} + baseBranches: ${{ parameters.baseBranches }} + dryRun: ${{ parameters.dryRun }} + forceRecreatePR: ${{ parameters.forceRecreatePR }} + pool: ${{ parameters.pool }} + arcadeRepoResource: ${{ parameters.arcadeRepoResource }} + selfRepoName: ${{ parameters.selfRepoName }} + arcadeRepoName: ${{ parameters.arcadeRepoName }} diff --git a/eng/common/core-templates/steps/install-microbuild-impl.yml b/eng/common/core-templates/steps/install-microbuild-impl.yml new file mode 100644 index 000000000000..da22beb3f60c --- /dev/null +++ b/eng/common/core-templates/steps/install-microbuild-impl.yml @@ -0,0 +1,34 @@ +parameters: + - name: microbuildTaskInputs + type: object + default: {} + + - name: microbuildEnv + type: object + default: {} + + - name: enablePreviewMicrobuild + type: boolean + default: false + + - name: condition + type: string + + - name: continueOnError + type: boolean + +steps: +- ${{ if eq(parameters.enablePreviewMicrobuild, true) }}: + - task: MicroBuildSigningPluginPreview@4 + displayName: Install Preview MicroBuild plugin + inputs: ${{ parameters.microbuildTaskInputs }} + env: ${{ parameters.microbuildEnv }} + continueOnError: ${{ parameters.continueOnError }} + condition: ${{ parameters.condition }} +- ${{ else }}: + - task: MicroBuildSigningPlugin@4 + displayName: Install MicroBuild plugin + inputs: ${{ parameters.microbuildTaskInputs }} + env: ${{ parameters.microbuildEnv }} + continueOnError: ${{ parameters.continueOnError }} + condition: ${{ parameters.condition }} diff --git a/eng/common/core-templates/steps/install-microbuild.yml b/eng/common/core-templates/steps/install-microbuild.yml index 553fce66b940..76a54e157fda 100644 --- a/eng/common/core-templates/steps/install-microbuild.yml +++ b/eng/common/core-templates/steps/install-microbuild.yml @@ -4,6 +4,8 @@ parameters: # Enable install tasks for MicroBuild on Mac and Linux # Will be ignored if 'enableMicrobuild' is false or 'Agent.Os' is 'Windows_NT' enableMicrobuildForMacAndLinux: false + # Enable preview version of MB signing plugin + enablePreviewMicrobuild: false # Determines whether the ESRP service connection information should be passed to the signing plugin. # This overlaps with _SignType to some degree. We only need the service connection for real signing. # It's important that the service connection not be passed to the MicroBuildSigningPlugin task in this place. @@ -13,6 +15,8 @@ parameters: microbuildUseESRP: true # Microbuild installation directory microBuildOutputFolder: $(Agent.TempDirectory)/MicroBuild + # Microbuild version + microbuildPluginVersion: 'latest' continueOnError: false @@ -69,42 +73,46 @@ steps: # YAML expansion, and Windows vs. Linux/Mac uses different service connections. However, # we can avoid including the MB install step if not enabled at all. This avoids a bunch of # extra pipeline authorizations, since most pipelines do not sign on non-Windows. - - task: MicroBuildSigningPlugin@4 - displayName: Install MicroBuild plugin (Windows) - inputs: - signType: $(_SignType) - zipSources: false - feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - ${{ if eq(parameters.microbuildUseESRP, true) }}: - ConnectedServiceName: 'MicroBuild Signing Task (DevDiv)' - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - ConnectedPMEServiceName: 6cc74545-d7b9-4050-9dfa-ebefcc8961ea - ${{ else }}: - ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca - env: - TeamName: $(_TeamName) - MicroBuildOutputFolderOverride: ${{ parameters.microBuildOutputFolder }} - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - continueOnError: ${{ parameters.continueOnError }} - condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'), in(variables['_SignType'], 'real', 'test')) - - - ${{ if eq(parameters.enableMicrobuildForMacAndLinux, true) }}: - - task: MicroBuildSigningPlugin@4 - displayName: Install MicroBuild plugin (non-Windows) - inputs: + - template: /eng/common/core-templates/steps/install-microbuild-impl.yml + parameters: + enablePreviewMicrobuild: ${{ parameters.enablePreviewMicrobuild }} + microbuildTaskInputs: signType: $(_SignType) zipSources: false feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - workingDirectory: ${{ parameters.microBuildOutputFolder }} + version: ${{ parameters.microbuildPluginVersion }} ${{ if eq(parameters.microbuildUseESRP, true) }}: ConnectedServiceName: 'MicroBuild Signing Task (DevDiv)' ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - ConnectedPMEServiceName: beb8cb23-b303-4c95-ab26-9e44bc958d39 + ConnectedPMEServiceName: 6cc74545-d7b9-4050-9dfa-ebefcc8961ea ${{ else }}: - ConnectedPMEServiceName: c24de2a5-cc7a-493d-95e4-8e5ff5cad2bc - env: + ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca + microbuildEnv: TeamName: $(_TeamName) MicroBuildOutputFolderOverride: ${{ parameters.microBuildOutputFolder }} SYSTEM_ACCESSTOKEN: $(System.AccessToken) continueOnError: ${{ parameters.continueOnError }} - condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'), eq(variables['_SignType'], 'real')) + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'), in(variables['_SignType'], 'real', 'test')) + + - ${{ if eq(parameters.enableMicrobuildForMacAndLinux, true) }}: + - template: /eng/common/core-templates/steps/install-microbuild-impl.yml + parameters: + enablePreviewMicrobuild: ${{ parameters.enablePreviewMicrobuild }} + microbuildTaskInputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + version: ${{ parameters.microbuildPluginVersion }} + workingDirectory: ${{ parameters.microBuildOutputFolder }} + ${{ if eq(parameters.microbuildUseESRP, true) }}: + ConnectedServiceName: 'MicroBuild Signing Task (DevDiv)' + ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: + ConnectedPMEServiceName: beb8cb23-b303-4c95-ab26-9e44bc958d39 + ${{ else }}: + ConnectedPMEServiceName: c24de2a5-cc7a-493d-95e4-8e5ff5cad2bc + microbuildEnv: + TeamName: $(_TeamName) + MicroBuildOutputFolderOverride: ${{ parameters.microBuildOutputFolder }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + continueOnError: ${{ parameters.continueOnError }} + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'), eq(variables['_SignType'], 'real')) diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index 4eed0312b807..84a1922c73f3 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -61,3 +61,4 @@ steps: condition: always() retryCountOnTaskFailure: 10 # for any files being locked isProduction: false # logs are non-production artifacts + diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml index 09ae5cd73ae3..b75f59c428d4 100644 --- a/eng/common/core-templates/steps/source-build.yml +++ b/eng/common/core-templates/steps/source-build.yml @@ -24,7 +24,7 @@ steps: # in the default public locations. internalRuntimeDownloadArgs= if [ '$(dotnetbuilds-internal-container-read-token-base64)' != '$''(dotnetbuilds-internal-container-read-token-base64)' ]; then - internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://ci.dot.net/internal --runtimesourcefeedkey '$(dotnetbuilds-internal-container-read-token-base64)'' + internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://ci.dot.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)' fi buildConfig=Release 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 e9a694afa58e..3ad83b8c3075 100644 --- a/eng/common/core-templates/steps/source-index-stage1-publish.yml +++ b/eng/common/core-templates/steps/source-index-stage1-publish.yml @@ -1,6 +1,6 @@ parameters: - sourceIndexUploadPackageVersion: 2.0.0-20250818.1 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20250818.1 + sourceIndexUploadPackageVersion: 2.0.0-20250906.1 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20250906.1 sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json binlogPath: artifacts/log/Debug/Build.binlog @@ -14,8 +14,8 @@ steps: workingDirectory: $(Agent.TempDirectory) - script: | - $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version ${{parameters.sourceIndexProcessBinlogPackageVersion}} --add-source ${{parameters.SourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools - $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version ${{parameters.sourceIndexUploadPackageVersion}} --add-source ${{parameters.SourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools + $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version ${{parameters.sourceIndexProcessBinlogPackageVersion}} --source ${{parameters.sourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools + $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version ${{parameters.sourceIndexUploadPackageVersion}} --source ${{parameters.sourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools displayName: "Source Index: Download netsourceindex Tools" # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk. workingDirectory: $(Agent.TempDirectory) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 8abfb71f7275..314c93c57598 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -9,6 +9,7 @@ usage() 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" + echo " for OpenBSD can be: openbsd" echo " for illumos can be: illumos" echo " for Haiku can be: haiku." echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine and FreeBSD" @@ -27,6 +28,8 @@ __BuildArch=arm __AlpineArch=armv7 __FreeBSDArch=arm __FreeBSDMachineArch=armv7 +__OpenBSDArch=arm +__OpenBSDMachineArch=armv7 __IllumosArch=arm7 __HaikuArch=arm __QEMUArch=arm @@ -72,7 +75,7 @@ __AlpinePackages+=" krb5-dev" __AlpinePackages+=" openssl-dev" __AlpinePackages+=" zlib-dev" -__FreeBSDBase="13.4-RELEASE" +__FreeBSDBase="13.5-RELEASE" __FreeBSDPkg="1.21.3" __FreeBSDABI="13" __FreeBSDPackages="libunwind" @@ -82,6 +85,12 @@ __FreeBSDPackages+=" openssl" __FreeBSDPackages+=" krb5" __FreeBSDPackages+=" terminfo-db" +__OpenBSDVersion="7.8" +__OpenBSDPackages="heimdal-libs" +__OpenBSDPackages+=" icu4c" +__OpenBSDPackages+=" inotify-tools" +__OpenBSDPackages+=" openssl" + __IllumosPackages="icu" __IllumosPackages+=" mit-krb5" __IllumosPackages+=" openssl" @@ -160,6 +169,8 @@ while :; do __QEMUArch=aarch64 __FreeBSDArch=arm64 __FreeBSDMachineArch=aarch64 + __OpenBSDArch=arm64 + __OpenBSDMachineArch=aarch64 ;; armel) __BuildArch=armel @@ -235,6 +246,8 @@ while :; do __UbuntuArch=amd64 __FreeBSDArch=amd64 __FreeBSDMachineArch=amd64 + __OpenBSDArch=amd64 + __OpenBSDMachineArch=amd64 __illumosArch=x86_64 __HaikuArch=x86_64 __UbuntuRepo="http://archive.ubuntu.com/ubuntu/" @@ -295,9 +308,7 @@ while :; do ;; noble) # Ubuntu 24.04 __CodeName=noble - if [[ -z "$__LLDB_Package" ]]; then - __LLDB_Package="liblldb-19-dev" - fi + __LLDB_Package="liblldb-19-dev" ;; stretch) # Debian 9 __CodeName=stretch @@ -383,10 +394,14 @@ while :; do ;; freebsd14) __CodeName=freebsd - __FreeBSDBase="14.2-RELEASE" + __FreeBSDBase="14.3-RELEASE" __FreeBSDABI="14" __SkipUnmount=1 ;; + openbsd) + __CodeName=openbsd + __SkipUnmount=1 + ;; illumos) __CodeName=illumos __SkipUnmount=1 @@ -595,6 +610,62 @@ elif [[ "$__CodeName" == "freebsd" ]]; then INSTALL_AS_USER=$(whoami) "$__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 + # determine mirrors + OPENBSD_MIRROR="https://cdn.openbsd.org/pub/OpenBSD/$__OpenBSDVersion/$__OpenBSDMachineArch" + + # download base system sets + ensureDownloadTool + + BASE_SETS=(base comp) + for set in "${BASE_SETS[@]}"; do + FILE="${set}${__OpenBSDVersion//./}.tgz" + echo "Downloading $FILE..." + if [[ "$__hasWget" == 1 ]]; then + wget -O- "$OPENBSD_MIRROR/$FILE" | tar -C "$__RootfsDir" -xzpf - + else + curl -SL "$OPENBSD_MIRROR/$FILE" | tar -C "$__RootfsDir" -xzpf - + fi + done + + PKG_MIRROR="https://cdn.openbsd.org/pub/OpenBSD/${__OpenBSDVersion}/packages/${__OpenBSDMachineArch}" + + echo "Installing packages into sysroot..." + + # Fetch package index once + if [[ "$__hasWget" == 1 ]]; then + PKG_INDEX=$(wget -qO- "$PKG_MIRROR/") + else + PKG_INDEX=$(curl -s "$PKG_MIRROR/") + fi + + for pkg in $__OpenBSDPackages; do + PKG_FILE=$(echo "$PKG_INDEX" | grep -Po ">\K${pkg}-[0-9][^\" ]*\.tgz" \ + | sort -V | tail -n1) + + echo "Resolved package filename for $pkg: $PKG_FILE" + + [[ -z "$PKG_FILE" ]] && { echo "ERROR: Package $pkg not found"; exit 1; } + + if [[ "$__hasWget" == 1 ]]; then + wget -O- "$PKG_MIRROR/$PKG_FILE" | tar -C "$__RootfsDir" -xzpf - + else + curl -SL "$PKG_MIRROR/$PKG_FILE" | tar -C "$__RootfsDir" -xzpf - + fi + done + + echo "Creating versionless symlinks for shared libraries..." + # Find all versioned .so files and create the base .so symlink + for lib in "$__RootfsDir/usr/lib/libc++.so."* "$__RootfsDir/usr/lib/libc++abi.so."* "$__RootfsDir/usr/lib/libpthread.so."*; do + if [ -f "$lib" ]; then + # Extract the filename (e.g., libc++.so.12.0) + VERSIONED_NAME=$(basename "$lib") + # Remove the trailing version numbers (e.g., libc++.so) + BASE_NAME=${VERSIONED_NAME%.so.*}.so + # Create the symlink in the same directory + ln -sf "$VERSIONED_NAME" "$__RootfsDir/usr/lib/$BASE_NAME" + fi + done elif [[ "$__CodeName" == "illumos" ]]; then mkdir "$__RootfsDir/tmp" pushd "$__RootfsDir/tmp" diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 0ff85cf0367e..99d6dfe82dde 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -3,15 +3,22 @@ set(CROSS_ROOTFS $ENV{ROOTFS_DIR}) # reset platform variables (e.g. cmake 3.25 sets LINUX=1) unset(LINUX) unset(FREEBSD) +unset(OPENBSD) unset(ILLUMOS) unset(ANDROID) unset(TIZEN) unset(HAIKU) set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH}) + +file(GLOB OPENBSD_PROBE "${CROSS_ROOTFS}/etc/signify/openbsd-*.pub") + if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version) set(CMAKE_SYSTEM_NAME FreeBSD) set(FREEBSD 1) +elseif(OPENBSD_PROBE) + set(CMAKE_SYSTEM_NAME OpenBSD) + set(OPENBSD 1) elseif(EXISTS ${CROSS_ROOTFS}/usr/platform/i86pc) set(CMAKE_SYSTEM_NAME SunOS) set(ILLUMOS 1) @@ -53,6 +60,8 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") endif() elseif(FREEBSD) set(triple "aarch64-unknown-freebsd12") + elseif(OPENBSD) + set(triple "aarch64-unknown-openbsd") endif() elseif(TARGET_ARCH_NAME STREQUAL "armel") set(CMAKE_SYSTEM_PROCESSOR armv7l) @@ -109,6 +118,8 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64") endif() elseif(FREEBSD) set(triple "x86_64-unknown-freebsd12") + elseif(OPENBSD) + set(triple "x86_64-unknown-openbsd") elseif(ILLUMOS) set(TOOLCHAIN "x86_64-illumos") elseif(HAIKU) @@ -193,7 +204,7 @@ if(ANDROID) # include official NDK toolchain script include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake) -elseif(FREEBSD) +elseif(FREEBSD OR OPENBSD) # we cross-compile by instructing clang set(CMAKE_C_COMPILER_TARGET ${triple}) set(CMAKE_CXX_COMPILER_TARGET ${triple}) @@ -214,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) @@ -291,7 +308,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|loongarch64|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) +if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|loongarch64|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD AND NOT OPENBSD) OR ILLUMOS OR HAIKU) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 index e33743105635..a5be41db6906 100644 --- a/eng/common/darc-init.ps1 +++ b/eng/common/darc-init.ps1 @@ -29,11 +29,11 @@ function InstallDarcCli ($darcVersion, $toolpath) { Write-Host "Installing Darc CLI version $darcVersion..." Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' if (-not $toolpath) { - Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g" - & "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g + Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --source '$arcadeServicesSource' -v $verbosity -g" + & "$dotnet" tool install $darcCliPackageName --version $darcVersion --source "$arcadeServicesSource" -v $verbosity -g }else { - Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'" - & "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath" + Write-Host "'$dotnet' tool install $darcCliPackageName --version $darcVersion --source '$arcadeServicesSource' -v $verbosity --tool-path '$toolpath'" + & "$dotnet" tool install $darcCliPackageName --version $darcVersion --source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath" } } diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index e889f439b8dc..b56d40e5706c 100755 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -5,7 +5,7 @@ darcVersion='' versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20' verbosity='minimal' -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in --darcversion) @@ -73,9 +73,9 @@ function InstallDarcCli { echo "Installing Darc CLI version $darcVersion..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." if [ -z "$toolpath" ]; then - echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g) + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --source "$arcadeServicesSource" -v $verbosity -g) else - echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") fi } diff --git a/eng/common/dotnet-install.ps1 b/eng/common/dotnet-install.ps1 index 811f0f717f73..50ae62737687 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 7b9d97e3bd4d..1cb3f5abac28 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -18,7 +18,7 @@ architecture='' runtime='dotnet' runtimeSourceFeed='' runtimeSourceFeedKey='' -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in -version|-v) @@ -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/dotnet.sh b/eng/common/dotnet.sh index 2ef68235675f..f6d24871c1d4 100755 --- a/eng/common/dotnet.sh +++ b/eng/common/dotnet.sh @@ -19,7 +19,7 @@ source $scriptroot/tools.sh InitializeDotNetCli true # install # Invoke acquired SDK with args if they are provided -if [[ $# > 0 ]]; then +if [[ $# -gt 0 ]]; then __dotnetDir=${_InitializeDotNetCli} dotnetPath=${__dotnetDir}/dotnet ${dotnetPath} "$@" diff --git a/eng/common/internal-feed-operations.sh b/eng/common/internal-feed-operations.sh index 9378223ba095..6299e7effd4c 100755 --- a/eng/common/internal-feed-operations.sh +++ b/eng/common/internal-feed-operations.sh @@ -100,7 +100,7 @@ operation='' authToken='' repoName='' -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in --operation) diff --git a/eng/common/native/init-distro-rid.sh b/eng/common/native/init-distro-rid.sh index 83ea7aab0e08..8fc6d2fec78d 100644 --- a/eng/common/native/init-distro-rid.sh +++ b/eng/common/native/init-distro-rid.sh @@ -39,6 +39,8 @@ getNonPortableDistroRid() # $rootfsDir can be empty. freebsd-version is a shell script and should always work. __freebsd_major_version=$("$rootfsDir"/bin/freebsd-version | cut -d'.' -f1) nonPortableRid="freebsd.$__freebsd_major_version-${targetArch}" + elif [ "$targetOs" = "openbsd" ]; then + nonPortableRid="openbsd.$(uname -r)-${targetArch}" elif command -v getprop >/dev/null && getprop ro.product.system.model | grep -qi android; then __android_sdk_version=$(getprop ro.build.version.sdk) nonPortableRid="android.$__android_sdk_version-${targetArch}" diff --git a/eng/common/native/install-dependencies.sh b/eng/common/native/install-dependencies.sh index 477a44f335be..4742177a7685 100755 --- a/eng/common/native/install-dependencies.sh +++ b/eng/common/native/install-dependencies.sh @@ -24,14 +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 + libssl-dev libkrb5-dev pigz cpio ninja-build 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" ]; then + 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 + $pkg_mgr install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio ninja-build + 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 elif [ "$ID" = "alpine" ]; then - apk add build-base cmake bash curl clang llvm-dev lld lldb krb5-dev lttng-ust-dev icu-dev openssl-dev pigz cpio + 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 else echo "Unsupported distro. distro: $ID" exit 1 @@ -52,6 +54,7 @@ brew "openssl@3" brew "pkgconf" brew "python3" brew "pigz" +brew "ninja" EOF ;; diff --git a/eng/common/post-build/redact-logs.ps1 b/eng/common/post-build/redact-logs.ps1 index 472d5bb562c9..672f4e2652ed 100644 --- a/eng/common/post-build/redact-logs.ps1 +++ b/eng/common/post-build/redact-logs.ps1 @@ -9,7 +9,8 @@ param( [Parameter(Mandatory=$false)][string] $TokensFilePath, [Parameter(ValueFromRemainingArguments=$true)][String[]]$TokensToRedact, [Parameter(Mandatory=$false)][string] $runtimeSourceFeed, - [Parameter(Mandatory=$false)][string] $runtimeSourceFeedKey) + [Parameter(Mandatory=$false)][string] $runtimeSourceFeedKey +) try { $ErrorActionPreference = 'Stop' @@ -48,8 +49,8 @@ try { Write-Host "Installing Binlog redactor CLI..." Write-Host "'$dotnet' new tool-manifest" & "$dotnet" new tool-manifest - Write-Host "'$dotnet' tool install $packageName --local --add-source '$PackageFeed' -v $verbosity --version $BinlogToolVersion" - & "$dotnet" tool install $packageName --local --add-source "$PackageFeed" -v $verbosity --version $BinlogToolVersion + Write-Host "'$dotnet' tool install $packageName --local --source '$PackageFeed' -v $verbosity --version $BinlogToolVersion" + & "$dotnet" tool install $packageName --local --source "$PackageFeed" -v $verbosity --version $BinlogToolVersion if (Test-Path $TokensFilePath) { Write-Host "Adding additional sensitive data for redaction from file: " $TokensFilePath diff --git a/eng/common/renovate.env b/eng/common/renovate.env new file mode 100644 index 000000000000..17ecc05d9b19 --- /dev/null +++ b/eng/common/renovate.env @@ -0,0 +1,42 @@ +# Renovate Global Configuration +# https://docs.renovatebot.com/self-hosted-configuration/ +# +# NOTE: This file uses bash/shell format and is sourced via `. renovate.env`. +# Values containing spaces or special characters must be quoted. + +# Author to use for git commits made by Renovate +# https://docs.renovatebot.com/configuration-options/#gitauthor +export RENOVATE_GIT_AUTHOR='.NET Renovate ' + +# Disable rate limiting for PR creation (0 = unlimited) +# https://docs.renovatebot.com/presets-default/#prhourlylimitnone +# https://docs.renovatebot.com/presets-default/#prconcurrentlimitnone +export RENOVATE_PR_HOURLY_LIMIT=0 +export RENOVATE_PR_CONCURRENT_LIMIT=0 + +# Skip the onboarding PR that Renovate normally creates for new repos +# https://docs.renovatebot.com/config-overview/#onboarding +export RENOVATE_ONBOARDING=false + +# Any Renovate config file in the cloned repository is ignored. Only +# the Renovate config file from the repo where the pipeline is running +# is used (yes, those are the same repo but the sources may be different). +# https://docs.renovatebot.com/self-hosted-configuration/#requireconfig +export RENOVATE_REQUIRE_CONFIG=ignored + +# Customize the PR body content. This removes some of the default +# sections that aren't relevant in a self-hosted config. +# https://docs.renovatebot.com/configuration-options/#prheader +# https://docs.renovatebot.com/configuration-options/#prbodynotes +# https://docs.renovatebot.com/configuration-options/#prbodytemplate +export RENOVATE_PR_HEADER='## Automated Dependency Update' +export RENOVATE_PR_BODY_NOTES='["This PR has been created automatically by the [.NET Renovate Bot](https://github.com/dotnet/arcade/blob/main/Documentation/Renovate.md) to update one or more dependencies in your repo. Please review the changes and merge the PR if everything looks good."]' +export RENOVATE_PR_BODY_TEMPLATE='{{{header}}}{{{table}}}{{{warnings}}}{{{notes}}}{{{changelogs}}}' + +# Extend the global config with additional presets +# https://docs.renovatebot.com/self-hosted-configuration/#globalextends +# Disable the Dependency Dashboard issue that tracks all updates +export RENOVATE_GLOBAL_EXTENDS='[":disableDependencyDashboard"]' + +# Allow all commands for post-upgrade commands. +export RENOVATE_ALLOWED_COMMANDS='[".*"]' diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index b64b66a6275b..68119de603ef 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -22,7 +22,7 @@ $warnAsError = if ($noWarnAsError) { $false } else { $true } function Print-Usage() { Write-Host "Common settings:" - Write-Host " -task Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)" + Write-Host " -task Name of Arcade task (name of a project in toolset directory of the Arcade SDK package)" Write-Host " -restore Restore dependencies" Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" Write-Host " -help Print help and exit" @@ -66,20 +66,7 @@ try { if( $msbuildEngine -eq "vs") { # Ensure desktop MSBuild is available for sdk tasks. - if( -not ($GlobalJson.tools.PSObject.Properties.Name -contains "vs" )) { - $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty - } - if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "18.0.0" -MemberType NoteProperty - } - if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { - $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true - } - if ($xcopyMSBuildToolsFolder -eq $null) { - throw 'Unable to get xcopy downloadable version of msbuild' - } - - $global:_MSBuildExe = "$($xcopyMSBuildToolsFolder)\MSBuild\Current\Bin\MSBuild.exe" + $global:_MSBuildExe = InitializeVisualStudioMSBuild } $taskProject = GetSdkTaskProject $task diff --git a/eng/common/sdk-task.sh b/eng/common/sdk-task.sh index 3270f83fa9a7..1cf71bb2aea4 100755 --- a/eng/common/sdk-task.sh +++ b/eng/common/sdk-task.sh @@ -2,7 +2,7 @@ show_usage() { echo "Common settings:" - echo " --task Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)" + echo " --task Name of Arcade task (name of a project in toolset directory of the Arcade SDK package)" echo " --restore Restore dependencies" echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" echo " --help Print help and exit" diff --git a/eng/common/template-guidance.md b/eng/common/template-guidance.md index e2b07a865f10..f772aa3d78fa 100644 --- a/eng/common/template-guidance.md +++ b/eng/common/template-guidance.md @@ -71,7 +71,6 @@ eng\common\ source-build.yml (shim) source-index-stage1.yml (shim) jobs\ - codeql-build.yml (shim) jobs.yml (shim) source-build.yml (shim) post-build\ @@ -88,7 +87,6 @@ eng\common\ source-build.yml (shim) variables\ pool-providers.yml (logic + redirect) # templates/variables/pool-providers.yml will redirect to templates-official/variables/pool-providers.yml if you are running in the internal project - sdl-variables.yml (logic) core-templates\ job\ job.yml (logic) @@ -97,7 +95,6 @@ eng\common\ source-build.yml (logic) source-index-stage1.yml (logic) jobs\ - codeql-build.yml (logic) jobs.yml (logic) source-build.yml (logic) post-build\ diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 977a2d4b1039..0e281df8cae5 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -34,6 +34,9 @@ # Configures warning treatment in msbuild. [bool]$warnAsError = if (Test-Path variable:warnAsError) { $warnAsError } else { $true } +# Specifies semi-colon delimited list of warning codes that should not be treated as errors. +[string]$warnNotAsError = if (Test-Path variable:warnNotAsError) { $warnNotAsError } else { '' } + # Specifies which msbuild engine to use for build: 'vs', 'dotnet' or unspecified (determined based on presence of tools.vs in global.json). [string]$msbuildEngine = if (Test-Path variable:msbuildEngine) { $msbuildEngine } else { $null } @@ -157,9 +160,6 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { return $global:_DotNetInstallDir } - # Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism - $env:DOTNET_MULTILEVEL_LOOKUP=0 - # Disable first run since we do not need all ASP.NET packages restored. $env:DOTNET_NOLOGO=1 @@ -168,6 +168,12 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 } + # Keep repo builds isolated from machine-installed SDK state and workload advertising. + # This avoids preview SDK builds picking up mismatched workloads on CI images. + $env:DOTNET_MULTILEVEL_LOOKUP = '0' + $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1' + $env:DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE = '1' + # Find the first path on %PATH% that contains the dotnet.exe if ($useInstalledDotNetCli -and (-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -eq $null)) { $dotnetExecutable = GetExecutableFileName 'dotnet' @@ -185,7 +191,11 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { if ((-not $globalJsonHasRuntimes) -and (-not [string]::IsNullOrEmpty($env:DOTNET_INSTALL_DIR)) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) { $dotnetRoot = $env:DOTNET_INSTALL_DIR } else { - $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' + } if (-not (Test-Path(Join-Path $dotnetRoot "sdk\$dotnetSdkVersion"))) { if ($install) { @@ -225,8 +235,10 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { # Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build Write-PipelinePrependPath -Path $dotnetRoot - Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0' Write-PipelineSetVariable -Name 'DOTNET_NOLOGO' -Value '1' + Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0' + Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1' + Write-PipelineSetVariable -Name 'DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE' -Value '1' return $global:_DotNetInstallDir = $dotnetRoot } @@ -299,6 +311,8 @@ function InstallDotNet([string] $dotnetRoot, $dotnetVersionLabel = "'sdk v$version'" + # For performance this check is duplicated in src/Microsoft.DotNet.Arcade.Sdk/src/InstallDotNetCore.cs + # if you are making changes here, consider if you need to make changes there as well. if ($runtime -ne '' -and $runtime -ne 'sdk') { $runtimePath = $dotnetRoot $runtimePath = $runtimePath + "\shared" @@ -374,12 +388,11 @@ function InstallDotNet([string] $dotnetRoot, # # 1. MSBuild from an active VS command prompt # 2. MSBuild from a compatible VS installation -# 3. MSBuild from the xcopy tool package # # Returns full path to msbuild.exe. # Throws on failure. # -function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $null) { +function InitializeVisualStudioMSBuild([object]$vsRequirements = $null) { if (-not (IsWindowsPlatform)) { throw "Cannot initialize Visual Studio on non-Windows" } @@ -389,13 +402,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = } # Minimum VS version to require. - $vsMinVersionReqdStr = '17.7' - $vsMinVersionReqd = [Version]::new($vsMinVersionReqdStr) - - # If the version of msbuild is going to be xcopied, - # use this version. Version matches a package here: - # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/18.0.0 - $defaultXCopyMSBuildVersion = '18.0.0' + $vsMinVersionReqdStr = '18.0' if (!$vsRequirements) { if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') { @@ -425,46 +432,16 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = } } - # Locate Visual Studio installation or download x-copy msbuild. + # Locate Visual Studio installation. $vsInfo = LocateVisualStudio $vsRequirements - if ($vsInfo -ne $null -and $env:ForceUseXCopyMSBuild -eq $null) { + if ($vsInfo -ne $null) { # Ensure vsInstallDir has a trailing slash $vsInstallDir = Join-Path $vsInfo.installationPath "\" $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] InitializeVisualStudioEnvironmentVariables $vsInstallDir $vsMajorVersion } else { - if (Get-Member -InputObject $GlobalJson.tools -Name 'xcopy-msbuild') { - $xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild' - $vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0] - } else { - #if vs version provided in global.json is incompatible (too low) then use the default version for xcopy msbuild download - if($vsMinVersion -lt $vsMinVersionReqd){ - Write-Host "Using xcopy-msbuild version of $defaultXCopyMSBuildVersion since VS version $vsMinVersionStr provided in global.json is not compatible" - $xcopyMSBuildVersion = $defaultXCopyMSBuildVersion - $vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0] - } - else{ - # If the VS version IS compatible, look for an xcopy msbuild package - # with a version matching VS. - # Note: If this version does not exist, then an explicit version of xcopy msbuild - # can be specified in global.json. This will be required for pre-release versions of msbuild. - $vsMajorVersion = $vsMinVersion.Major - $vsMinorVersion = $vsMinVersion.Minor - $xcopyMSBuildVersion = "$vsMajorVersion.$vsMinorVersion.0" - } - } - - $vsInstallDir = $null - if ($xcopyMSBuildVersion.Trim() -ine "none") { - $vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install - if ($vsInstallDir -eq $null) { - throw "Could not xcopy msbuild. Please check that package 'Microsoft.DotNet.Arcade.MSBuild.Xcopy @ $xcopyMSBuildVersion' exists on feed 'dotnet-eng'." - } - } - if ($vsInstallDir -eq $null) { - throw 'Unable to find Visual Studio that has required version and components installed' - } + throw 'Unable to find Visual Studio that has required version and components installed' } $msbuildVersionDir = if ([int]$vsMajorVersion -lt 16) { "$vsMajorVersion.0" } else { "Current" } @@ -491,38 +468,6 @@ function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [str } } -function InstallXCopyMSBuild([string]$packageVersion) { - return InitializeXCopyMSBuild $packageVersion -install $true -} - -function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) { - $packageName = 'Microsoft.DotNet.Arcade.MSBuild.Xcopy' - $packageDir = Join-Path $ToolsDir "msbuild\$packageVersion" - $packagePath = Join-Path $packageDir "$packageName.$packageVersion.nupkg" - - if (!(Test-Path $packageDir)) { - if (!$install) { - return $null - } - - Create-Directory $packageDir - - Write-Host "Downloading $packageName $packageVersion" - $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit - Retry({ - Invoke-WebRequest "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/flat2/$packageName/$packageVersion/$packageName.$packageVersion.nupkg" -UseBasicParsing -OutFile $packagePath - }) - - if (!(Test-Path $packagePath)) { - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "See https://dev.azure.com/dnceng/internal/_wiki/wikis/DNCEng%20Services%20Wiki/1074/Updating-Microsoft.DotNet.Arcade.MSBuild.Xcopy-WAS-RoslynTools.MSBuild-(xcopy-msbuild)-generation?anchor=troubleshooting for help troubleshooting issues with XCopy MSBuild" - throw - } - Unzip $packagePath $packageDir - } - - return Join-Path $packageDir 'tools' -} - # # Locates Visual Studio instance that meets the minimal requirements specified by tools.vs object in global.json. # @@ -544,7 +489,6 @@ function LocateVisualStudio([object]$vsRequirements = $null){ if (Get-Member -InputObject $GlobalJson.tools -Name 'vswhere') { $vswhereVersion = $GlobalJson.tools.vswhere } else { - # keep this in sync with the VSWhereVersion in DefaultVersions.props $vswhereVersion = '3.1.7' } @@ -592,6 +536,11 @@ function LocateVisualStudio([object]$vsRequirements = $null){ return $null } + if ($null -eq $vsInfo -or $vsInfo.Count -eq 0) { + throw "No instance of Visual Studio meeting the requirements specified was found. Requirements: $($args -join ' ')" + return $null + } + # use first matching instance return $vsInfo[0] } @@ -627,7 +576,7 @@ function InitializeBuildTool() { $buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'net' } } elseif ($msbuildEngine -eq "vs") { try { - $msbuildPath = InitializeVisualStudioMSBuild -install:$restore + $msbuildPath = InitializeVisualStudioMSBuild } catch { Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ ExitWithExitCode 1 @@ -674,7 +623,13 @@ function GetNuGetPackageCachePath() { # Returns a full path to an Arcade SDK task project file. function GetSdkTaskProject([string]$taskName) { - return Join-Path (Split-Path (InitializeToolset) -Parent) "SdkTasks\$taskName.proj" + $toolsetDir = Split-Path (InitializeToolset) -Parent + $proj = Join-Path $toolsetDir "$taskName.proj" + if (Test-Path $proj) { + return $proj + } + + throw "Unable to find $taskName.proj in toolset at: $toolsetDir" } function InitializeNativeTools() { @@ -711,13 +666,18 @@ function InitializeToolset() { $nugetCache = GetNuGetPackageCachePath $toolsetVersion = Read-ArcadeSdkVersion - $toolsetLocationFile = Join-Path $ToolsetDir "$toolsetVersion.txt" + $toolsetToolsDir = Join-Path $ToolsetDir $toolsetVersion - if (Test-Path $toolsetLocationFile) { - $path = Get-Content $toolsetLocationFile -TotalCount 1 - if (Test-Path $path) { - return $global:_InitializeToolset = $path - } + # Check if the toolset has already been extracted + $toolsetBuildProj = $null + $buildProjPath = Join-Path $toolsetToolsDir 'Build.proj' + + if (Test-Path $buildProjPath) { + $toolsetBuildProj = $buildProjPath + } + + if ($toolsetBuildProj -ne $null) { + return $global:_InitializeToolset = $toolsetBuildProj } if (-not $restore) { @@ -725,21 +685,41 @@ function InitializeToolset() { ExitWithExitCode 1 } - $buildTool = InitializeBuildTool + $downloadArgs = @("package", "download", "Microsoft.DotNet.Arcade.Sdk@$toolsetVersion", "--verbosity", "minimal", "--prerelease", "--output", "$nugetCache") + $nugetConfig = $env:NUGET_CONFIG + if (-not $nugetConfig) { + # Search for any variation of nuget.config in the RepoRoot + $configFile = Get-ChildItem -Path $RepoRoot -File | Where-Object { $_.Name -ieq "nuget.config" } | Select-Object -First 1 + + if ($configFile) { + $nugetConfig = $configFile.FullName + } + } + + if ($nugetConfig) { + $downloadArgs += "--configfile" + $downloadArgs += $nugetConfig + } + DotNet @downloadArgs - $proj = Join-Path $ToolsetDir 'restore.proj' - $bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'ToolsetRestore.binlog') } else { '' } + $packageDir = Join-Path $nugetCache (Join-Path 'microsoft.dotnet.arcade.sdk' $toolsetVersion) + $packageToolsetDir = Join-Path $packageDir 'toolset' - '' | Set-Content $proj + if (!(Test-Path $packageToolsetDir)) { + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Arcade SDK package does not contain a toolset or tools folder: $packageDir" + ExitWithExitCode 3 + } - MSBuild-Core $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile + New-Item -ItemType Directory -Path $toolsetToolsDir -Force | Out-Null + Copy-Item -Path "$packageToolsetDir\*" -Destination $toolsetToolsDir -Recurse -Force - $path = Get-Content $toolsetLocationFile -Encoding UTF8 -TotalCount 1 - if (!(Test-Path $path)) { - throw "Invalid toolset path: $path" + if (Test-Path $buildProjPath) { + $toolsetBuildProj = $buildProjPath + } else { + throw "Unable to find Build.proj in toolset at: $toolsetToolsDir" } - return $global:_InitializeToolset = $path + return $global:_InitializeToolset = $toolsetBuildProj } function ExitWithExitCode([int] $exitCode) { @@ -800,6 +780,40 @@ function MSBuild() { 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. @@ -824,6 +838,10 @@ function MSBuild-Core() { $cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci" + if ($ci -and $buildTool.Tool -eq 'dotnet') { + $cmdArgs += ' /p:MSBuildEnableWorkloadResolver=false' + } + # Add -mt flag for MSBuild multithreaded mode if enabled via environment variable if ($env:MSBUILD_MT_ENABLED -eq "1") { $cmdArgs += ' -mt' @@ -836,6 +854,10 @@ function MSBuild-Core() { $cmdArgs += ' /p:TreatWarningsAsErrors=false' } + if ($warnAsError -and $warnNotAsError) { + $cmdArgs += " /warnnotaserror:$warnNotAsError /p:AdditionalWarningsNotAsErrors=$warnNotAsError" + } + foreach ($arg in $args) { if ($null -ne $arg -and $arg.Trim() -ne "") { if ($arg.EndsWith('\')) { @@ -930,6 +952,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 diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 1b296f646c23..5ff37cfb7000 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -52,6 +52,9 @@ fi # Configures warning treatment in msbuild. warn_as_error=${warn_as_error:-true} +# Specifies semi-colon delimited list of warning codes that should not be treated as errors. +warn_not_as_error=${warn_not_as_error:-''} + # True to attempt using .NET Core already that meets requirements specified in global.json # installed on the machine instead of downloading one. use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} @@ -115,9 +118,6 @@ function InitializeDotNetCli { local install=$1 - # Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism - export DOTNET_MULTILEVEL_LOOKUP=0 - # Disable first run since we want to control all package sources export DOTNET_NOLOGO=1 @@ -126,6 +126,12 @@ function InitializeDotNetCli { export DOTNET_CLI_TELEMETRY_OPTOUT=1 fi + # Keep repo builds isolated from machine-installed SDK state and workload advertising. + # This avoids preview SDK builds picking up mismatched workloads on CI images. + export DOTNET_MULTILEVEL_LOOKUP=0 + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + export DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE=1 + # LTTNG is the logging infrastructure used by Core CLR. Need this variable set # so it doesn't output warnings to the console. export LTTNG_HOME="$HOME" @@ -148,7 +154,11 @@ function InitializeDotNetCli { if [[ $global_json_has_runtimes == false && -n "${DOTNET_INSTALL_DIR:-}" && -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then dotnet_root="$DOTNET_INSTALL_DIR" else - dotnet_root="${repo_root}.dotnet" + if [[ -n "${DOTNET_GLOBAL_INSTALL_DIR:-}" ]]; then + dotnet_root="$DOTNET_GLOBAL_INSTALL_DIR" + else + dotnet_root="${repo_root}.dotnet" + fi export DOTNET_INSTALL_DIR="$dotnet_root" @@ -166,8 +176,10 @@ function InitializeDotNetCli { # build steps from using anything other than what we've downloaded. Write-PipelinePrependPath -path "$dotnet_root" - Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0" Write-PipelineSetVariable -name "DOTNET_NOLOGO" -value "1" + Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0" + Write-PipelineSetVariable -name "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" -value "1" + Write-PipelineSetVariable -name "DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE" -value "1" # return value _InitializeDotNetCli="$dotnet_root" @@ -188,6 +200,8 @@ function InstallDotNet { local version=$2 local runtime=$4 + # For performance this check is duplicated in src/Microsoft.DotNet.Arcade.Sdk/src/InstallDotNetCore.cs + # if you are making changes here, consider if you need to make changes there as well. local dotnetVersionLabel="'$runtime v$version'" if [[ -n "${4:-}" ]] && [ "$4" != 'sdk' ]; then runtimePath="$root" @@ -406,15 +420,18 @@ function InitializeToolset { ReadGlobalVersion "Microsoft.DotNet.Arcade.Sdk" local toolset_version=$_ReadGlobalVersion - local toolset_location_file="$toolset_dir/$toolset_version.txt" + local toolset_tools_dir="$toolset_dir/$toolset_version" - if [[ -a "$toolset_location_file" ]]; then - local path=`cat "$toolset_location_file"` - if [[ -a "$path" ]]; then - # return value - _InitializeToolset="$path" - return - fi + # Check if the toolset has already been extracted + local toolset_build_proj="" + if [[ -a "$toolset_tools_dir/Build.proj" ]]; then + toolset_build_proj="$toolset_tools_dir/Build.proj" + fi + + if [[ -n "$toolset_build_proj" ]]; then + # return value + _InitializeToolset="$toolset_build_proj" + return fi if [[ "$restore" != true ]]; then @@ -422,20 +439,37 @@ function InitializeToolset { ExitWithExitCode 2 fi - local proj="$toolset_dir/restore.proj" + local download_args=("package" "download" "Microsoft.DotNet.Arcade.Sdk@$toolset_version" "--verbosity" "minimal" "--prerelease" "--output" "$_GetNuGetPackageCachePath") + local nuget_config="${NUGET_CONFIG:-}" + if [[ -z "$nuget_config" ]]; then + # Search for any variation of nuget.config in the RepoRoot + local found_config + found_config=$(find "$repo_root" -maxdepth 1 -type f -iname "nuget.config" -print -quit) + + if [[ -n "$found_config" ]]; then + nuget_config="$found_config" + fi + fi - local bl="" - if [[ "$binary_log" == true ]]; then - bl="/bl:$log_dir/ToolsetRestore.binlog" + if [[ -n "$nuget_config" ]]; then + download_args+=("--configfile" "$nuget_config") fi + DotNet "${download_args[@]}" + + local package_dir="$_GetNuGetPackageCachePath/microsoft.dotnet.arcade.sdk/$toolset_version" - echo '' > "$proj" - MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file" + if [[ ! -d "$package_dir/toolset" ]]; then + Write-PipelineTelemetryError -category 'InitializeToolset' "Arcade SDK package does not contain a toolset folder: $package_dir" + ExitWithExitCode 3 + fi - local toolset_build_proj=`cat "$toolset_location_file"` + mkdir -p "$toolset_tools_dir" + cp -r "$package_dir/toolset/." "$toolset_tools_dir" - if [[ ! -a "$toolset_build_proj" ]]; then - Write-PipelineTelemetryError -category 'Build' "Invalid toolset path: $toolset_build_proj" + if [[ -a "$toolset_tools_dir/Build.proj" ]]; then + toolset_build_proj="$toolset_tools_dir/Build.proj" + else + Write-PipelineTelemetryError -category 'Build' "Unable to find Build.proj in toolset at: $toolset_tools_dir" ExitWithExitCode 3 fi @@ -457,6 +491,26 @@ function StopProcesses { return 0 } +function DotNet { + InitializeDotNetCli $restore + + local dotnet_path="$_InitializeDotNetCli/dotnet" + + export ARCADE_BUILD_TOOL_COMMAND="$dotnet_path $@" + + "$dotnet_path" "$@" || { + local exit_code=$? + echo "dotnet command failed with exit code $exit_code. Check errors above." + + if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$from_vmr" != true ]]; then + Write-PipelineSetResult -result "Failed" -message "dotnet command execution failed." + ExitWithExitCode 0 + else + ExitWithExitCode $exit_code + fi + } +} + function MSBuild { local args=( "$@" ) if [[ "$pipelines_log" == true ]]; then @@ -532,7 +586,17 @@ function MSBuild-Core { mt_switch="-mt" fi - RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch $mt_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" + local warnnotaserror_switch="" + if [[ -n "$warn_not_as_error" && "$warn_as_error" == true ]]; then + warnnotaserror_switch="/warnnotaserror:$warn_not_as_error /p:AdditionalWarningsNotAsErrors=$warn_not_as_error" + fi + + local workload_resolver_switch="" + if [[ "$ci" == true && -n "${_InitializeBuildToolCommand:-}" ]]; then + workload_resolver_switch="/p:MSBuildEnableWorkloadResolver=false" + fi + + RunBuildTool "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch $mt_switch $warnnotaserror_switch $workload_resolver_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" } function GetDarc { @@ -549,8 +613,17 @@ function GetDarc { # Returns a full path to an Arcade SDK task project file. function GetSdkTaskProject { - taskName=$1 - echo "$(dirname $_InitializeToolset)/SdkTasks/$taskName.proj" + local taskName=$1 + local toolsetDir + toolsetDir="$(dirname "$_InitializeToolset")" + local proj="$toolsetDir/$taskName.proj" + if [[ -a "$proj" ]]; then + echo "$proj" + return + fi + + Write-PipelineTelemetryError -category 'Build' "Unable to find $taskName.proj in toolset at: $toolsetDir" + ExitWithExitCode 3 } ResolvePath "${BASH_SOURCE[0]}" @@ -588,6 +661,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" diff --git a/global.json b/global.json index dc89b8f57c94..857012f1d5f3 100644 --- a/global.json +++ b/global.json @@ -7,7 +7,7 @@ "errorMessage": "The .NET SDK is not installed or is not configured correctly. Please run ./build to install the correct SDK version locally." }, "tools": { - "dotnet": "10.0.300", + "dotnet": "11.0.100-preview.5.26227.104", "runtimes": { "dotnet": [ "$(MicrosoftNETCorePlatformsPackageVersion)" @@ -21,10 +21,10 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.26264.101", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.26264.101", - "Microsoft.Build.NoTargets": "3.7.0", + "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26261.101", + "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.26261.101", + "Microsoft.Build.NoTargets": "3.7.134", "Microsoft.Build.Traversal": "3.4.0", - "Microsoft.WixToolset.Sdk": "5.0.2-dotnet.2811440" + "Microsoft.WixToolset.Sdk": "6.0.3-dotnet.4" } -} +} \ No newline at end of file