Skip to content

Commit

Permalink
Merge branch 'release/9.0' into merge/release/9.0-rc2-to-release/9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lewing committed Sep 22, 2024
2 parents 69aa2f2 + 9c9e77e commit 153304e
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 27 deletions.
28 changes: 14 additions & 14 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
<Sha>526b22d829bc9b420dff6ef70877a67053b66e0f</Sha>
<SourceBuild RepoName="cecil" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport" Version="9.0.0-rc.2.24468.8">
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport" Version="9.0.0-rtm.24469.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>0b30e0253a0d7c47a99cecd51b0d5ff5c83ad1df</Sha>
<Sha>8e660ff41e91879977e3a9d837e068bd72234c26</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.emsdk" Version="9.0.0-rc.2.24468.8">
<Dependency Name="Microsoft.SourceBuild.Intermediate.emsdk" Version="9.0.0-rtm.24469.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>0b30e0253a0d7c47a99cecd51b0d5ff5c83ad1df</Sha>
<Sha>8e660ff41e91879977e3a9d837e068bd72234c26</Sha>
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
Expand Down Expand Up @@ -348,25 +348,25 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>8674aaa459d33551d419fece377f5512a1d93689</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="9.0.0-alpha.0.24467.1">
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="9.0.0-alpha.0.24468.1">
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
<Sha>2a5c6e56551930ae44071d4f152d769825c38b58</Sha>
<Sha>5763d13f0cde0912dc320f832646c8eda8cfeb23</Sha>
</Dependency>
<Dependency Name="System.Runtime.Numerics.TestData" Version="9.0.0-beta.24459.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.12.0-3.24463.9">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.12.0-3.24469.1">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>df4ae6b81013ac45367372176b9c3135a35a7e3c</Sha>
<Sha>f869d0f8a872875a46ba9fe23c67b04eb5519c2e</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis" Version="4.12.0-3.24463.9">
<Dependency Name="Microsoft.CodeAnalysis" Version="4.12.0-3.24469.1">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>df4ae6b81013ac45367372176b9c3135a35a7e3c</Sha>
<Sha>f869d0f8a872875a46ba9fe23c67b04eb5519c2e</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.24463.9">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.24469.1">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>df4ae6b81013ac45367372176b9c3135a35a7e3c</Sha>
<Sha>f869d0f8a872875a46ba9fe23c67b04eb5519c2e</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24454.1">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
Expand All @@ -377,9 +377,9 @@
<Sha>a7c74cf887abe4a38240bc4ead0b221d9d42434f</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.12.0-3.24463.9">
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.12.0-3.24469.1">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>df4ae6b81013ac45367372176b9c3135a35a7e3c</Sha>
<Sha>f869d0f8a872875a46ba9fe23c67b04eb5519c2e</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="9.0.100-rc.2.24466.7">
Expand Down
14 changes: 7 additions & 7 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<!-- Enable to remove prerelease label. -->
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
<WorkloadVersionSuffix Condition="'$(DotNetFinalVersionKind)' != 'release' and '$(PreReleaseVersionIteration)' == ''">-$(PreReleaseVersionLabel)</WorkloadVersionSuffix>
<WorkloadVersionSuffix Condition="'$(WorkloadVersionSuffix)' == '' and '$(DotNetFinalVersionKind)' != 'release'">-$(PreReleaseVersionLabel).$(PreReleaseVersionIteration)</WorkloadVersionSuffix>
<WorkloadVersionSuffix Condition="'$(DotNetFinalVersionKind)' != 'release' and '$(PreReleaseVersionIteration)' == '' and '$(PreReleaseVersionLabel)' != 'rtm'">-$(PreReleaseVersionLabel)</WorkloadVersionSuffix>
<WorkloadVersionSuffix Condition="'$(WorkloadVersionSuffix)' == '' and '$(DotNetFinalVersionKind)' != 'release' and '$(PreReleaseVersionLabel)' != 'rtm'">-$(PreReleaseVersionLabel).$(PreReleaseVersionIteration)</WorkloadVersionSuffix>
<SdkBandVersionForWorkload_FromRuntimeVersions>$(SdkBandVersion)$(WorkloadVersionSuffix)</SdkBandVersionForWorkload_FromRuntimeVersions>
<!-- Set assembly version to align with major and minor version,
as for the patches and revisions should be manually updated per assembly if it is serviced. -->
Expand All @@ -44,9 +44,9 @@
Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure
they do not break the local dev experience.
-->
<MicrosoftCodeAnalysisCSharpVersion>4.12.0-3.24463.9</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.12.0-3.24463.9</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.12.0-3.24463.9</MicrosoftNetCompilersToolsetVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.12.0-3.24469.1</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.12.0-3.24469.1</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.12.0-3.24469.1</MicrosoftNetCompilersToolsetVersion>
</PropertyGroup>
<!--
For source generator support we need to target multiple versions of Roslyn in order to be able to run on older versions of Roslyn.
Expand Down Expand Up @@ -184,7 +184,7 @@
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>9.0.0-prerelease.24405.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>9.0.0-prerelease.24405.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>9.0.0-prerelease.24405.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>9.0.0-alpha.0.24467.1</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>9.0.0-alpha.0.24468.1</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<NUnitVersion>3.12.0</NUnitVersion>
<NUnit3TestAdapterVersion>4.5.0</NUnit3TestAdapterVersion>
<CoverletCollectorVersion>6.0.0</CoverletCollectorVersion>
Expand Down Expand Up @@ -240,7 +240,7 @@
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-9_0_100_Transport
-->
<MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-rc.2.24468.8</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
<MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>9.0.0-rtm.24469.1</MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion)</MicrosoftNETRuntimeEmscriptenVersion>
<!-- workloads -->
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public static bool IsNullable(this IParameterSymbol parameter)
{
// Because System.Text.Json cannot distinguish between nullable and non-nullable type parameters,
// (e.g. the same metadata is being used for both KeyValuePair<string, string?> and KeyValuePair<string, string>),
// we derive nullability annotations from the original definition of the field and not instation.
// we derive nullability annotations from the original definition of the field and not its instantiation.
// This preserves compatibility with the capabilities of the reflection-based NullabilityInfo reader.
parameter = parameter.OriginalDefinition;
return !IsInputTypeNonNullable(parameter, parameter.Type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ private static void GenerateCtorParamMetadataInitFunc(SourceWriter writer, strin
Name = {{FormatStringLiteral(spec.Name)}},
ParameterType = typeof({{spec.ParameterType.FullyQualifiedName}}),
Position = {{spec.ParameterIndex}},
IsNullable = {{FormatBoolLiteral(spec.IsNullable)}},
IsMemberInitializer = true,
},
""");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,7 @@ private void ProcessMember(
ParameterType = property.PropertyType,
MatchesConstructorParameter = matchingConstructorParameter is not null,
ParameterIndex = matchingConstructorParameter?.ParameterIndex ?? paramCount++,
IsNullable = property.PropertyType.CanBeNull && !property.IsSetterNonNullableAnnotation,
};

(propertyInitializers ??= new()).Add(propertyInitializer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ public sealed record PropertyInitializerGenerationSpec
public required int ParameterIndex { get; init; }

public required bool MatchesConstructorParameter { get; init; }

public required bool IsNullable { get; init; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,21 @@ internal void SetItem(string propertyName, JsonNode? value)

OrderedDictionary<string, JsonNode?> dict = Dictionary;

if (dict.TryGetValue(propertyName, out JsonNode? replacedValue))
if (!dict.TryAdd(propertyName, value))
{
int index = dict.IndexOf(propertyName);
Debug.Assert(index >= 0);
JsonNode? replacedValue = dict.GetAt(index).Value;

if (ReferenceEquals(value, replacedValue))
{
return;
}

DetachParent(replacedValue);
dict.SetAt(index, value);
}

dict[propertyName] = value;
value?.AssignParent(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public static IEnumerable<object[]> GetTypesWithNonNullablePropertyGetter()
yield return Wrap(typeof(NotNullableSpecialTypePropertiesClass), nameof(NotNullableSpecialTypePropertiesClass.JsonDocument));
yield return Wrap(typeof(NullableObliviousConstructorParameter), nameof(NullableObliviousConstructorParameter.Property));
yield return Wrap(typeof(NotNullGenericPropertyClass<string>), nameof(NotNullGenericPropertyClass<string>.Property));
yield return Wrap(typeof(ClassWithNonNullableInitProperty), nameof(ClassWithNonNullableInitProperty.Property));
yield return Wrap(typeof(ClassWithNonNullableInitProperty), nameof(ClassWithNonNullableRequiredProperty.Property));

static object[] Wrap(Type type, string propertyName) => [type, propertyName];
}
Expand Down Expand Up @@ -125,6 +127,8 @@ public static IEnumerable<object[]> GetTypesWithNullablePropertyGetter()
yield return Wrap(typeof(NullableObliviousPropertyClass), nameof(NullableObliviousPropertyClass.Property));
yield return Wrap(typeof(GenericPropertyClass<string>), nameof(GenericPropertyClass<string>.Property));
yield return Wrap(typeof(NullableGenericPropertyClass<string>), nameof(NullableGenericPropertyClass<string>.Property));
yield return Wrap(typeof(ClassWithNullableInitProperty), nameof(ClassWithNullableInitProperty.Property));
yield return Wrap(typeof(ClassWithNullableInitProperty), nameof(ClassWithNullableRequiredProperty.Property));

static object[] Wrap(Type type, string propertyName) => [type, propertyName];
}
Expand Down Expand Up @@ -191,6 +195,8 @@ public static IEnumerable<object[]> GetTypesWithNonNullablePropertySetter()
yield return Wrap(typeof(DisallowNullConstructorParameter), nameof(DisallowNullConstructorParameter.Property));
yield return Wrap(typeof(DisallowNullConstructorParameter<string>), nameof(DisallowNullConstructorParameter<string>.Property));
yield return Wrap(typeof(NotNullGenericConstructorParameter<string>), nameof(NotNullGenericConstructorParameter<string>.Property));
yield return Wrap(typeof(ClassWithNonNullableInitProperty), nameof(ClassWithNonNullableInitProperty.Property));
yield return Wrap(typeof(ClassWithNonNullableInitProperty), nameof(ClassWithNonNullableRequiredProperty.Property));

static object[] Wrap(Type type, string propertyName) => [type, propertyName];
}
Expand Down Expand Up @@ -249,6 +255,8 @@ public static IEnumerable<object[]> GetTypesWithNullablePropertySetter()
yield return Wrap(typeof(AllowNullConstructorParameter<string>), nameof(AllowNullConstructorParameter<string>.Property));
yield return Wrap(typeof(GenericConstructorParameter<string>), nameof(GenericConstructorParameter<string>.Property));
yield return Wrap(typeof(NullableGenericConstructorParameter<string>), nameof(NullableGenericConstructorParameter<string>.Property));
yield return Wrap(typeof(ClassWithNullableInitProperty), nameof(ClassWithNullableInitProperty.Property));
yield return Wrap(typeof(ClassWithNullableInitProperty), nameof(ClassWithNullableRequiredProperty.Property));

static object[] Wrap(Type type, string propertyName) => [type, propertyName];
}
Expand Down Expand Up @@ -765,5 +773,25 @@ public class NullableFieldClass
[JsonInclude]
public string? Field;
}

public class ClassWithNullableInitProperty
{
public string? Property { get; init; }
}

public class ClassWithNonNullableInitProperty
{
public string Property { get; init; }
}

public class ClassWithNullableRequiredProperty
{
public required string? Property { get; set; }
}

public class ClassWithNonNullableRequiredProperty
{
public required string Property { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ protected NullableAnnotationsTests_Metadata(JsonSerializerWrapper serializer)
[JsonSerializable(typeof(NullableGenericConstructorParameter<string>))]
[JsonSerializable(typeof(NotNullGenericConstructorParameter<string>))]
[JsonSerializable(typeof(NotNullablePropertyWithIgnoreConditions))]
[JsonSerializable(typeof(ClassWithNullableInitProperty))]
[JsonSerializable(typeof(ClassWithNonNullableInitProperty))]
[JsonSerializable(typeof(ClassWithNullableRequiredProperty))]
[JsonSerializable(typeof(ClassWithNonNullableRequiredProperty))]
internal sealed partial class NullableAnnotationsTestsContext_Metadata
: JsonSerializerContext { }
}
Expand Down Expand Up @@ -128,6 +132,10 @@ protected NullableAnnotationsTests_Default(JsonSerializerWrapper serializer)
[JsonSerializable(typeof(NullableGenericConstructorParameter<string>))]
[JsonSerializable(typeof(NotNullGenericConstructorParameter<string>))]
[JsonSerializable(typeof(NotNullablePropertyWithIgnoreConditions))]
[JsonSerializable(typeof(ClassWithNullableInitProperty))]
[JsonSerializable(typeof(ClassWithNonNullableInitProperty))]
[JsonSerializable(typeof(ClassWithNullableRequiredProperty))]
[JsonSerializable(typeof(ClassWithNonNullableRequiredProperty))]
internal sealed partial class NullableAnnotationsTestsContext_Default
: JsonSerializerContext
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<Exec Condition="$(_DotNetVersionExitCode) != '0'" Command="$(_DotNetVersionCommand)" CustomErrorRegularExpression=".*" />

<PropertyGroup>
<SdkBandVersionForWorkload_ComputedFromInstaller>$(SdkBandVersion)$([System.Text.RegularExpressions.Regex]::Match($(_DotNetVersionOutput), `-[A-z]*[\.]*\d*`))</SdkBandVersionForWorkload_ComputedFromInstaller>
<SdkBandVersionForWorkload_ComputedFromInstaller>$(SdkBandVersion)$([System.Text.RegularExpressions.Regex]::Match($(_DotNetVersionOutput), `-(?!rtm)[A-z]*[\.]*\d*`))</SdkBandVersionForWorkload_ComputedFromInstaller>
<VersionBandForSdkManifestsDir Condition="'$(VersionBandForSdkManifestsDir)' == ''">$(SdkBandVersionForWorkload_ComputedFromInstaller)</VersionBandForSdkManifestsDir>
<VersionBandForManifestPackages Condition="'$(VersionBandForManifestPackages)' == ''">$(VersionBandForSdkManifestsDir)</VersionBandForManifestPackages>
</PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public partial class InstallWorkloadFromArtifacts : PatchNuGetConfig
ReadCommentHandling = JsonCommentHandling.Skip
};

[GeneratedRegex(@"^\d+\.\d+\.\d+(-[A-z]*\.*\d*)?")]
[GeneratedRegex(@"^\d+\.\d+\.\d+(-(?!rtm)[A-z]*\.*\d*)?")]
private static partial Regex bandVersionRegex();

public override bool Execute()
Expand Down Expand Up @@ -301,7 +301,8 @@ private bool InstallWorkloadManifest(ITaskItem workloadId, string name, string v
if (!string.IsNullOrEmpty(bandPreleaseVersion) &&
packagePreleaseVersion != bandPreleaseVersion &&
packagePreleaseVersion != "-dev" &&
packagePreleaseVersion != "-ci")
packagePreleaseVersion != "-ci" &&
packagePreleaseVersion != "-rtm")
{
bandVersion = bandVersion.Replace (bandPreleaseVersion, packagePreleaseVersion);
}
Expand Down

0 comments on commit 153304e

Please sign in to comment.