Fix source-build tarball build in main (#14162)
* Add runtime patch to fully qualify conflicting runtime and roslyn APIs * Delete unnecessary aspnetcore patches * Use repo name for git-info version number special cases
This commit is contained in:
parent
999fa51758
commit
e4d35dc39d
4 changed files with 44 additions and 41 deletions
|
@ -64,7 +64,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks
|
|||
string repoName = dependency.SourceBuildRepoName;
|
||||
string safeRepoName = repoName.Replace("-", "").Replace(".", "");
|
||||
string propsPath = Path.Combine(SourceBuildMetadataDir, $"{repoName.Replace(".", "-")}.props");
|
||||
DerivedVersion derivedVersion = GetVersionInfo(dependency.Version, "0");
|
||||
DerivedVersion derivedVersion = GetVersionInfo(safeRepoName, dependency.Version, "0");
|
||||
var repoProps = new Dictionary<string, string>
|
||||
{
|
||||
["GitCommitHash"] = dependency.Sha,
|
||||
|
@ -92,17 +92,18 @@ namespace Microsoft.DotNet.SourceBuild.Tasks
|
|||
/// Reverse a version in the Arcade style (https://github.com/dotnet/arcade/blob/fb92b14d8cd07cf44f8f7eefa8ac58d7ffd05f3f/src/Microsoft.DotNet.Arcade.Sdk/tools/Version.BeforeCommonTargets.targets#L18)
|
||||
/// back to an OfficialBuildId + ReleaseLabel which we can then supply to get the same resulting version number.
|
||||
/// </summary>
|
||||
/// <param name="repoName">The source build name of the repo to get the version info for.</param>
|
||||
/// <param name="version">The complete version, e.g. 1.0.0-beta1-19720.5</param>
|
||||
/// <param name="commitCount">The current commit count of the repo. This is used for some repos that do not use the standard versioning scheme.</param>
|
||||
/// <returns></returns>
|
||||
private static DerivedVersion GetVersionInfo(string version, string commitCount)
|
||||
private static DerivedVersion GetVersionInfo(string repoName, string version, string commitCount)
|
||||
{
|
||||
var nugetVersion = new NuGetVersion(version);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(nugetVersion.Release))
|
||||
{
|
||||
var releaseParts = nugetVersion.Release.Split('-', '.');
|
||||
if (releaseParts.Length == 2)
|
||||
if (repoName.Contains("nuget"))
|
||||
{
|
||||
// NuGet does this - arbitrary build IDs
|
||||
return new DerivedVersion { OfficialBuildId = DateTime.Now.ToString("yyyyMMdd.1"), PreReleaseVersionLabel = releaseParts[0] };
|
||||
|
@ -110,7 +111,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks
|
|||
else if (releaseParts.Length == 3)
|
||||
{
|
||||
// VSTest uses full dates for the first part of their preview build numbers
|
||||
if (DateTime.TryParseExact(releaseParts[1], "yyyyMMdd", new CultureInfo("en-US"), DateTimeStyles.AssumeLocal, out DateTime fullDate))
|
||||
if (repoName.Contains("vstest"))
|
||||
{
|
||||
return new DerivedVersion { OfficialBuildId = $"{releaseParts[1]}.{releaseParts[2]}", PreReleaseVersionLabel = releaseParts[0] };
|
||||
}
|
||||
|
@ -138,7 +139,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks
|
|||
else
|
||||
{
|
||||
// finalized version number (x.y.z) - probably not our code
|
||||
// VSTest, Application Insights, Newtonsoft.Json do this
|
||||
// Application Insights, Newtonsoft.Json do this
|
||||
return new DerivedVersion { OfficialBuildId = DateTime.Now.ToString("yyyyMMdd.1"), PreReleaseVersionLabel = string.Empty };
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@ public class WebScenarioTests : SmokeTests
|
|||
}
|
||||
|
||||
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.Razor, DotNetActions.Build | DotNetActions.Run | DotNetActions.Publish);
|
||||
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.BlazorWasm, DotNetActions.Build | DotNetActions.Run | DotNetActions.Publish);
|
||||
// Disable building blazorwasm tests until https://github.com/dotnet/source-build/issues/2946 is addressed
|
||||
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.BlazorWasm /*DotNetActions.Build | DotNetActions.Run | DotNetActions.Publish*/);
|
||||
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.BlazorServer, DotNetActions.Build | DotNetActions.Run | DotNetActions.Publish);
|
||||
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.Worker);
|
||||
yield return new(nameof(WebScenarioTests), DotNetLanguage.CSharp, DotNetTemplate.Angular);
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Logan Bussell <loganbussell@microsoft.com>
|
||||
Date: Tue, 12 Jul 2022 13:50:55 -0700
|
||||
Subject: [PATCH] Revert "[Infrastructure] Update SDK version (#42571)"
|
||||
|
||||
Temporarily rollback https://github.com/dotnet/aspnetcore/pull/42571
|
||||
(aefef28a51afd41d358eb0573e10cd858dcdc3e3) because source-build is still using an older
|
||||
toolset. This will be addressed by @crummel in https://github.com/dotnet/installer/pull/14089.
|
||||
---
|
||||
src/Servers/Kestrel/Core/src/Internal/Http/HttpParser.cs | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/Servers/Kestrel/Core/src/Internal/Http/HttpParser.cs b/src/Servers/Kestrel/Core/src/Internal/Http/HttpParser.cs
|
||||
index 63fc8668d6..5e18ba0861 100644
|
||||
--- a/src/Servers/Kestrel/Core/src/Internal/Http/HttpParser.cs
|
||||
+++ b/src/Servers/Kestrel/Core/src/Internal/Http/HttpParser.cs
|
||||
@@ -313,7 +313,7 @@ public class HttpParser<TRequestHandler> : IHttpParser<TRequestHandler> where TR
|
||||
}
|
||||
|
||||
SequencePosition lineEnd;
|
||||
- scoped ReadOnlySpan<byte> headerSpan;
|
||||
+ ReadOnlySpan<byte> headerSpan;
|
||||
if (currentSlice.Slice(reader.Position, lineEndPosition.Value).Length == currentSlice.Length - 1)
|
||||
{
|
||||
// No enough data, so CRLF can't currently be there.
|
||||
@@ -321,8 +321,7 @@ public class HttpParser<TRequestHandler> : IHttpParser<TRequestHandler> where TR
|
||||
|
||||
// Advance 1 to include CR/LF in lineEnd
|
||||
lineEnd = currentSlice.GetPosition(1, lineEndPosition.Value);
|
||||
- var header = currentSlice.Slice(reader.Position, lineEnd);
|
||||
- headerSpan = header.IsSingleSegment ? header.FirstSpan : header.ToArray();
|
||||
+ headerSpan = currentSlice.Slice(reader.Position, lineEnd).ToSpan();
|
||||
if (headerSpan[^1] != ByteCR)
|
||||
{
|
||||
RejectRequestHeader(headerSpan);
|
|
@ -0,0 +1,36 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Logan Bussell <loganbussell@microsoft.com>
|
||||
Date: Thu, 14 Jul 2022 14:53:35 -0700
|
||||
Subject: [PATCH] Fully qualify conflicting runtime and roslyn APIs
|
||||
|
||||
---
|
||||
.../System.Private.CoreLib/gen/EventSourceGenerator.Parser.cs | 2 +-
|
||||
.../System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/libraries/System.Private.CoreLib/gen/EventSourceGenerator.Parser.cs b/src/libraries/System.Private.CoreLib/gen/EventSourceGenerator.Parser.cs
|
||||
index 43a498b589a..1bad8f3753c 100644
|
||||
--- a/src/libraries/System.Private.CoreLib/gen/EventSourceGenerator.Parser.cs
|
||||
+++ b/src/libraries/System.Private.CoreLib/gen/EventSourceGenerator.Parser.cs
|
||||
@@ -15,7 +15,7 @@ namespace Generators
|
||||
{
|
||||
public partial class EventSourceGenerator
|
||||
{
|
||||
- private static EventSourceClass? GetSemanticTargetForGeneration(GeneratorAttributeSyntaxContext context, CancellationToken cancellationToken)
|
||||
+ private static EventSourceClass? GetSemanticTargetForGeneration(Microsoft.CodeAnalysis.DotnetRuntime.Extensions.GeneratorAttributeSyntaxContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
const string EventSourceAttribute = "System.Diagnostics.Tracing.EventSourceAttribute";
|
||||
|
||||
diff --git a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs
|
||||
index 33dd18fc67f..13005b9d0a9 100644
|
||||
--- a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs
|
||||
+++ b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs
|
||||
@@ -20,7 +20,7 @@ public partial class RegexGenerator
|
||||
|
||||
// Returns null if nothing to do, Diagnostic if there's an error to report, or RegexType if the type was analyzed successfully.
|
||||
private static object? GetSemanticTargetForGeneration(
|
||||
- GeneratorAttributeSyntaxContext context, CancellationToken cancellationToken)
|
||||
+ Microsoft.CodeAnalysis.DotnetRuntime.Extensions.GeneratorAttributeSyntaxContext context, CancellationToken cancellationToken)
|
||||
{
|
||||
var methodSyntax = (MethodDeclarationSyntax)context.TargetNode;
|
||||
SemanticModel sm = context.SemanticModel;
|
Loading…
Add table
Add a link
Reference in a new issue