Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit de33b6e

Browse files
committed
Merge in 'release/2.2' changes
2 parents e7903f4 + caa7879 commit de33b6e

File tree

30 files changed

+714
-42
lines changed

30 files changed

+714
-42
lines changed

buildpipeline/DotNet-CoreFx-Trusted-Linux.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@
487487
"allowOverride": true
488488
},
489489
"PB_TargetQueue": {
490-
"value": "Centos.73.Amd64+RedHat.73.Amd64+Debian.87.Amd64+Debian.90.Amd64+Debian.9.Amd64+Ubuntu.1404.Amd64+Ubuntu.1604.Amd64+Ubuntu.1804.Amd64+opensuse.423.amd64+SLES.12.Amd64+Fedora.27.Amd64+Fedora.28.Amd64"
490+
"value": "Centos.7.Amd64+RedHat.7.Amd64+Debian.8.Amd64+Debian.9.Amd64+Ubuntu.1404.Amd64+Ubuntu.1604.Amd64+Ubuntu.1804.Amd64+opensuse.42.amd64+SLES.12.Amd64+Fedora.27.Amd64+Fedora.28.Amd64"
491491
},
492492
"PB_VsoAccountName": {
493493
"value": "dn-bot"

buildpipeline/centos.6.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ simpleDockerNode('microsoft/dotnet-buildtools-prereqs:centos-6-376e1a3-201743110
4747
// Get the user that should be associated with the submission
4848
def helixCreator = getUser()
4949
// Target queues
50-
def targetHelixQueues = ['RedHat.69.Amd64.Open']
50+
def targetHelixQueues = ['RedHat.6.Amd64.Open']
5151

5252
sh "LD_LIBRARY_PATH=/usr/local/lib ./Tools/msbuild.sh src/upload-tests.proj /p:ArchGroup=x64 /p:ConfigurationGroup=${params.CGroup} /p:TestProduct=corefx /p:TimeoutInSeconds=1200 /p:TargetOS=Linux /p:HelixJobType=test/functional/cli/ /p:HelixSource=${helixSource} /p:BuildMoniker=${helixBuild} /p:HelixCreator=${helixCreator} /p:CloudDropAccountName=dotnetbuilddrops /p:CloudResultsAccountName=dotnetjobresults /p:CloudDropAccessToken=\$CloudDropAccessToken /p:CloudResultsAccessToken=\$OutputCloudResultsAccessToken /p:HelixApiEndpoint=https://helix.dot.net/api/2017-04-14/jobs /p:TargetQueues=${targetHelixQueues.join('+')} /p:HelixLogFolder=${WORKSPACE}/${logFolder}/ /p:HelixCorrelationInfoFileName=SubmittedHelixRuns.txt"
5353

buildpipeline/linux.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ simpleDockerNode('microsoft/dotnet-buildtools-prereqs:rhel7_prereqs_2') {
4747
// Get the user that should be associated with the submission
4848
def helixCreator = getUser()
4949
// Target queues
50-
def targetHelixQueues = ['Centos.74.Amd64.Open',
51-
'RedHat.74.Amd64.Open',
52-
'Debian.87.Amd64.Open',
50+
def targetHelixQueues = ['Centos.7.Amd64.Open',
51+
'RedHat.7.Amd64.Open',
52+
'Debian.8.Amd64.Open',
5353
'Ubuntu.1404.Amd64.Open',
5454
'Ubuntu.1604.Amd64.Open',
5555
'Ubuntu.1804.Amd64.Open',
56-
'OpenSuse.423.Amd64.Open',
56+
'OpenSuse.42.Amd64.Open',
5757
'Fedora.27.Amd64.Open',]
5858
if (params.TestOuter) {
5959
targetHelixQueues += ['Debian.9.Amd64.Open',

buildpipeline/pipeline.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"PB_BuildArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -stripSymbols -- /p:StabilizePackageVersion=$(PB_IsStable) /p:PackageVersionStamp=$(PB_VersionStamp)",
2424
"PB_BuildTestsArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -SkipTests -Outerloop -- /p:ArchiveTests=true /p:EnableDumpling=true",
2525
"PB_SyncArguments": "-p -- /p:ArchGroup=x64 /p:DotNetRestoreSources=$(PB_RestoreSource) /p:DotNetAssetRootUrl=$(PB_AssetRootUrl)",
26-
"PB_TargetQueue": "Centos.73.Amd64+Centos.74.Amd64+RedHat.73.Amd64+RedHat.74.Amd64+Debian.87.Amd64+Debian.90.Amd64+Ubuntu.1404.Amd64+Ubuntu.1604.Amd64+Ubuntu.1804.Amd64+OpenSuse.423.Amd64+SLES.12.Amd64+Fedora.27.Amd64+Fedora.28.Amd64",
26+
"PB_TargetQueue": "Centos.7.Amd64+RedHat.7.Amd64+RedHat.7.Amd64+Debian.8.Amd64+Debian.9.Amd64+Ubuntu.1404.Amd64+Ubuntu.1604.Amd64+Ubuntu.1804.Amd64+OpenSuse.42.Amd64+SLES.12.Amd64+Fedora.27.Amd64+Fedora.28.Amd64",
2727
"PB_CreateHelixArguments": "/p:ArchGroup=x64 /p:ConfigurationGroup=$(PB_ConfigurationGroup) /p:TestProduct=corefx /p:TimeoutInSeconds=1200 /p:TargetOS=Linux"
2828
},
2929
"ReportingParameters": {
@@ -39,7 +39,7 @@
3939
"PB_BuildArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -stripSymbols -RuntimeOS=rhel.6 -- /p:PortableBuild=false /p:StabilizePackageVersion=$(PB_IsStable) /p:PackageVersionStamp=$(PB_VersionStamp)",
4040
"PB_BuildTestsArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -SkipTests -Outerloop -RuntimeOS=rhel.6 -- /p:ArchiveTests=true /p:EnableDumpling=true /p:PortableBuild=false",
4141
"PB_SyncArguments": "-p -RuntimeOS=rhel.6 -- /p:ArchGroup=x64 /p:PortableBuild=false /p:DotNetRestoreSources=$(PB_RestoreSource) /p:DotNetAssetRootUrl=$(PB_AssetRootUrl)",
42-
"PB_TargetQueue": "RedHat.69.Amd64",
42+
"PB_TargetQueue": "RedHat.6.Amd64",
4343
"PB_CreateHelixArguments": "/p:ArchGroup=x64 /p:ConfigurationGroup=$(PB_ConfigurationGroup) /p:TestProduct=corefx /p:TimeoutInSeconds=1200 /p:TargetOS=Linux"
4444
},
4545
"ReportingParameters": {

external/harvestPackages/harvestPackages.props

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
<Version>4.5.1</Version>
5151
</PackageReference>
5252
<PackageReference Include="System.Diagnostics.DiagnosticSource">
53-
<Version>4.5.0</Version>
53+
<Version>4.5.1</Version>
5454
</PackageReference>
5555
<PackageReference Include="System.Drawing.Common">
56-
<Version>4.5.0</Version>
56+
<Version>4.5.1</Version>
5757
</PackageReference>
5858
<PackageReference Include="System.IO.FileSystem.AccessControl">
5959
<Version>4.5.0</Version>
@@ -68,16 +68,16 @@
6868
<Version>4.5.0</Version>
6969
</PackageReference>
7070
<PackageReference Include="System.IO.Pipelines">
71-
<Version>4.5.0</Version>
71+
<Version>4.5.2</Version>
7272
</PackageReference>
7373
<PackageReference Include="System.Json">
7474
<Version>4.5.0</Version>
7575
</PackageReference>
7676
<PackageReference Include="System.Net.Http.WinHttpHandler">
77-
<Version>4.5.0</Version>
77+
<Version>4.5.1</Version>
7878
</PackageReference>
7979
<PackageReference Include="System.Net.WebSockets.WebSocketProtocol">
80-
<Version>4.5.1</Version>
80+
<Version>4.5.2</Version>
8181
</PackageReference>
8282
<PackageReference Include="System.Numerics.Vectors">
8383
<Version>4.5.0</Version>
@@ -92,7 +92,7 @@
9292
<Version>4.5.1</Version>
9393
</PackageReference>
9494
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
95-
<Version>4.5.1</Version>
95+
<Version>4.5.2</Version>
9696
</PackageReference>
9797
<PackageReference Include="System.Security.AccessControl">
9898
<Version>4.5.0</Version>
@@ -104,7 +104,7 @@
104104
<Version>4.5.0</Version>
105105
</PackageReference>
106106
<PackageReference Include="System.Security.Cryptography.Pkcs">
107-
<Version>4.5.0</Version>
107+
<Version>4.5.1</Version>
108108
</PackageReference>
109109
<PackageReference Include="System.Security.Cryptography.ProtectedData">
110110
<Version>4.5.0</Version>
@@ -116,7 +116,7 @@
116116
<Version>4.5.0</Version>
117117
</PackageReference>
118118
<PackageReference Include="System.Security.Principal.Windows">
119-
<Version>4.5.0</Version>
119+
<Version>4.5.1</Version>
120120
</PackageReference>
121121
<PackageReference Include="System.ServiceProcess.ServiceController">
122122
<Version>4.5.0</Version>

pkg/Microsoft.Private.PackageBaseline/packageIndex.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
"2.0.0",
131131
"2.1.0",
132132
"2.1.1",
133+
"2.1.2",
133134
"2.2.0"
134135
],
135136
"BaselineVersion": "2.0.0",
@@ -4310,7 +4311,8 @@
43104311
"4.0.1.0": "4.3.0",
43114312
"4.0.2.0": "4.4.0",
43124313
"4.0.3.0": "4.5.0",
4313-
"4.0.3.1": "4.5.1"
4314+
"4.0.3.1": "4.5.1",
4315+
"4.0.3.2": "4.5.2"
43144316
}
43154317
},
43164318
"System.Security.Cryptography.Primitives": {

src/Common/src/System/Security/Cryptography/Asn1V2.Serializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private static Serializer GetSerializer(Type typeT, FieldInfo fieldInfo)
502502
{
503503
return (obj, writer) =>
504504
{
505-
using (AsnWriter tmp = new AsnWriter(AsnEncodingRules.DER))
505+
using (AsnWriter tmp = new AsnWriter(writer.RuleSet))
506506
{
507507
serializer(obj, tmp);
508508

src/CoreFx.Private.TestUtilities/pkg/CoreFx.Private.TestUtilities.pkgproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
<ProjectReference Include="..\ref\CoreFx.Private.TestUtilities.csproj">
66
<SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
77
</ProjectReference>
8-
<ProjectReference Include="..\src\CoreFx.Private.TestUtilities.csproj"/>
8+
<ProjectReference Include="..\src\CoreFx.Private.TestUtilities.csproj">
9+
<SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
10+
</ProjectReference>
911
</ItemGroup>
12+
<PropertyGroup>
13+
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
14+
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
15+
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
16+
</PropertyGroup>
1017
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
1118
</Project>

src/System.Globalization.Calendars/tests/CalendarHelpers.cs

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public enum DataType
1616
Month = 2,
1717
Day = 8
1818
}
19-
19+
2020
public static Calendar[] s_calendars = new Calendar[]
2121
{
2222
new ThaiBuddhistCalendar(),
@@ -55,6 +55,25 @@ private static int MaxCalendarYearInEra(Calendar calendar, int era)
5555
return calendar.GetYear(calendar.ToDateTime(1, 1, 1, 0, 0, 0, 0, era + 1).AddDays(-1)) + 1;
5656
}
5757

58+
// Get the max year in the passed era plus the sum of the max year for each subsequent era
59+
private static int MaxCalendarYearInEras(Calendar calendar, int era)
60+
{
61+
int[] eras = calendar.Eras;
62+
Assert.InRange(era, 0, eras[0]);
63+
if (eras.Length == 1 || era == eras[0] || era == 0)
64+
{
65+
return MaxCalendarYearInEra(calendar, era);
66+
}
67+
68+
int year = 0;
69+
for (int i = era; i <= calendar.Eras[0]; i++)
70+
{
71+
year += MaxCalendarYearInEra(calendar, i);
72+
}
73+
74+
return year;
75+
}
76+
5877
private static int MaxGregorianYearInEra(Calendar calendar, int era)
5978
{
6079
int[] eras = calendar.Eras;
@@ -92,7 +111,8 @@ public static IEnumerable<object[]> Calendars_TestData()
92111
{
93112
foreach (Calendar calendar in s_calendars)
94113
{
95-
yield return new object[] { calendar };
114+
if (!(calendar is JapaneseLunisolarCalendar) || !PlatformDetection.IsFullFramework)
115+
yield return new object[] { calendar };
96116
}
97117
}
98118

@@ -102,12 +122,12 @@ public static IEnumerable<object[]> Year_Month_Day_Era_TestData(DataType type, b
102122
int day = 1;
103123
foreach (Calendar calendar in s_calendars)
104124
{
105-
if (ignoreJapaneseLunisolarCalendar && calendar is JapaneseLunisolarCalendar)
125+
if (calendar is JapaneseLunisolarCalendar && (ignoreJapaneseLunisolarCalendar || PlatformDetection.IsFullFramework))
106126
{
107127
// desktop has a bug in JapaneseLunisolarCalendar which is fixed in .Net Core.
108128
// in case of a new era starts in the middle of a month which means part of the month will belong to one
109-
// era and the rest will belong to the new era. When calculating the calendar year number for dates which
110-
// in the rest of the month and exist in the new started era, we should still use the old era info instead
129+
// era and the rest will belong to the new era. When calculating the calendar year number for dates which
130+
// in the rest of the month and exist in the new started era, we should still use the old era info instead
111131
// of the new era info because the rest of the month still belong to the year of last era.
112132
// https://github.com/dotnet/coreclr/pull/3662
113133
continue;
@@ -119,7 +139,8 @@ public static IEnumerable<object[]> Year_Month_Day_Era_TestData(DataType type, b
119139
// Year is invalid
120140
yield return new object[] { calendar, -1, month, day, era, "year" };
121141
yield return new object[] { calendar, 0, month, day, era, "year" };
122-
yield return new object[] { calendar, MaxCalendarYearInEra(calendar, era) + 1, month, day, era, "year" };
142+
143+
yield return new object[] { calendar, MaxCalendarYearInEras(calendar, era) + 1, month, day, era, "year" };
123144

124145
if ((type & DataType.Month) != 0)
125146
{
@@ -158,7 +179,7 @@ public static IEnumerable<object[]> DateTime_TestData()
158179
DateTime maxDate = calendar.MaxSupportedDateTime;
159180
if (maxDate != DateTime.MaxValue)
160181
{
161-
yield return new object[] { calendar, maxDate.AddDays(1) };
182+
yield return new object[] { calendar, maxDate.AddDays(1) };
162183
}
163184
}
164185
}
@@ -334,7 +355,7 @@ public static void ToDateTime_Invalid(Calendar calendar)
334355
// Year is invalid
335356
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(-1, month, day, hour, minute, second, millisecond, era));
336357
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(0, month, day, hour, minute, second, millisecond, era));
337-
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(MaxCalendarYearInEra(calendar, era) + 1, month, day, hour, minute, second, millisecond, era));
358+
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(MaxCalendarYearInEras(calendar, era) + 1, month, day, hour, minute, second, millisecond, era));
338359

339360
// Month is invalid
340361
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(year, -1, day, hour, minute, second, millisecond, era));
@@ -388,7 +409,7 @@ public static void ToFourDigitYear_Invalid(Calendar calendar)
388409
{
389410
AssertExtensions.Throws<ArgumentOutOfRangeException>("year", () => calendar.ToFourDigitYear(-1));
390411
AssertExtensions.Throws<ArgumentOutOfRangeException>("year", () => calendar.ToFourDigitYear(MaxCalendarYearInEra(calendar, MaxEra(calendar)) + 1));
391-
412+
392413
if (!(calendar is JapaneseLunisolarCalendar))
393414
{
394415
AssertExtensions.Throws<ArgumentOutOfRangeException>("year", () => calendar.ToFourDigitYear(MinCalendarYearInEra(calendar, MinEra(calendar)) - 2));
@@ -460,5 +481,16 @@ public static void GetDayOfWeek_Invalid(Calendar calendar, DateTime dt)
460481
AssertExtensions.Throws<ArgumentOutOfRangeException>("time", () => calendar.GetDayOfWeek(dt));
461482
}
462483
}
484+
485+
[Fact]
486+
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
487+
public static void TestJapaneseCalendarDateParsing()
488+
{
489+
CultureInfo ciJapanese = new CultureInfo("ja-JP") { DateTimeFormat = { Calendar = new JapaneseCalendar() } };
490+
491+
DateTime dt = new DateTime(1970, 1, 1);
492+
string eraName = dt.ToString("gg", ciJapanese);
493+
Assert.Equal(new DateTime(1995, 1, 1), DateTime.Parse(eraName + " 70/1/1 0:00:00", ciJapanese));
494+
}
463495
}
464496
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.Collections.Generic;
7+
using Xunit;
8+
9+
namespace System.Globalization.Tests
10+
{
11+
public static class CalendarTests
12+
{
13+
[Fact]
14+
public static void TestJapaneseCalendarDateParsing()
15+
{
16+
CultureInfo ciJapanese = new CultureInfo("ja-JP") { DateTimeFormat = { Calendar = new JapaneseCalendar() } };
17+
18+
DateTime dt = new DateTime(1970, 1, 1);
19+
string eraName = dt.ToString("gg", ciJapanese);
20+
21+
// Legacy behavior which we used to throw when using a year number exceeding the era max year.
22+
Assert.ThrowsAny<FormatException>(() => DateTime.Parse(eraName + " 70/1/1 0:00:00", ciJapanese));
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)