Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Merge in 'release/2.2' changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot committed Dec 3, 2018
2 parents e7903f4 + caa7879 commit de33b6e
Show file tree
Hide file tree
Showing 30 changed files with 714 additions and 42 deletions.
2 changes: 1 addition & 1 deletion buildpipeline/DotNet-CoreFx-Trusted-Linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
"allowOverride": true
},
"PB_TargetQueue": {
"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"
"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"
},
"PB_VsoAccountName": {
"value": "dn-bot"
Expand Down
2 changes: 1 addition & 1 deletion buildpipeline/centos.6.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ simpleDockerNode('microsoft/dotnet-buildtools-prereqs:centos-6-376e1a3-201743110
// Get the user that should be associated with the submission
def helixCreator = getUser()
// Target queues
def targetHelixQueues = ['RedHat.69.Amd64.Open']
def targetHelixQueues = ['RedHat.6.Amd64.Open']

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"

Expand Down
8 changes: 4 additions & 4 deletions buildpipeline/linux.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ simpleDockerNode('microsoft/dotnet-buildtools-prereqs:rhel7_prereqs_2') {
// Get the user that should be associated with the submission
def helixCreator = getUser()
// Target queues
def targetHelixQueues = ['Centos.74.Amd64.Open',
'RedHat.74.Amd64.Open',
'Debian.87.Amd64.Open',
def targetHelixQueues = ['Centos.7.Amd64.Open',
'RedHat.7.Amd64.Open',
'Debian.8.Amd64.Open',
'Ubuntu.1404.Amd64.Open',
'Ubuntu.1604.Amd64.Open',
'Ubuntu.1804.Amd64.Open',
'OpenSuse.423.Amd64.Open',
'OpenSuse.42.Amd64.Open',
'Fedora.27.Amd64.Open',]
if (params.TestOuter) {
targetHelixQueues += ['Debian.9.Amd64.Open',
Expand Down
4 changes: 2 additions & 2 deletions buildpipeline/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"PB_BuildArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -stripSymbols -- /p:StabilizePackageVersion=$(PB_IsStable) /p:PackageVersionStamp=$(PB_VersionStamp)",
"PB_BuildTestsArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -SkipTests -Outerloop -- /p:ArchiveTests=true /p:EnableDumpling=true",
"PB_SyncArguments": "-p -- /p:ArchGroup=x64 /p:DotNetRestoreSources=$(PB_RestoreSource) /p:DotNetAssetRootUrl=$(PB_AssetRootUrl)",
"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",
"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",
"PB_CreateHelixArguments": "/p:ArchGroup=x64 /p:ConfigurationGroup=$(PB_ConfigurationGroup) /p:TestProduct=corefx /p:TimeoutInSeconds=1200 /p:TargetOS=Linux"
},
"ReportingParameters": {
Expand All @@ -39,7 +39,7 @@
"PB_BuildArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -stripSymbols -RuntimeOS=rhel.6 -- /p:PortableBuild=false /p:StabilizePackageVersion=$(PB_IsStable) /p:PackageVersionStamp=$(PB_VersionStamp)",
"PB_BuildTestsArguments": "-buildArch=x64 -$(PB_ConfigurationGroup) -SkipTests -Outerloop -RuntimeOS=rhel.6 -- /p:ArchiveTests=true /p:EnableDumpling=true /p:PortableBuild=false",
"PB_SyncArguments": "-p -RuntimeOS=rhel.6 -- /p:ArchGroup=x64 /p:PortableBuild=false /p:DotNetRestoreSources=$(PB_RestoreSource) /p:DotNetAssetRootUrl=$(PB_AssetRootUrl)",
"PB_TargetQueue": "RedHat.69.Amd64",
"PB_TargetQueue": "RedHat.6.Amd64",
"PB_CreateHelixArguments": "/p:ArchGroup=x64 /p:ConfigurationGroup=$(PB_ConfigurationGroup) /p:TestProduct=corefx /p:TimeoutInSeconds=1200 /p:TargetOS=Linux"
},
"ReportingParameters": {
Expand Down
16 changes: 8 additions & 8 deletions external/harvestPackages/harvestPackages.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.DiagnosticSource">
<Version>4.5.0</Version>
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.Drawing.Common">
<Version>4.5.0</Version>
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.IO.FileSystem.AccessControl">
<Version>4.5.0</Version>
Expand All @@ -68,16 +68,16 @@
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.IO.Pipelines">
<Version>4.5.0</Version>
<Version>4.5.2</Version>
</PackageReference>
<PackageReference Include="System.Json">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.Net.Http.WinHttpHandler">
<Version>4.5.0</Version>
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.Net.WebSockets.WebSocketProtocol">
<Version>4.5.1</Version>
<Version>4.5.2</Version>
</PackageReference>
<PackageReference Include="System.Numerics.Vectors">
<Version>4.5.0</Version>
Expand All @@ -92,7 +92,7 @@
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe">
<Version>4.5.1</Version>
<Version>4.5.2</Version>
</PackageReference>
<PackageReference Include="System.Security.AccessControl">
<Version>4.5.0</Version>
Expand All @@ -104,7 +104,7 @@
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.Pkcs">
<Version>4.5.0</Version>
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.ProtectedData">
<Version>4.5.0</Version>
Expand All @@ -116,7 +116,7 @@
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Principal.Windows">
<Version>4.5.0</Version>
<Version>4.5.1</Version>
</PackageReference>
<PackageReference Include="System.ServiceProcess.ServiceController">
<Version>4.5.0</Version>
Expand Down
4 changes: 3 additions & 1 deletion pkg/Microsoft.Private.PackageBaseline/packageIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"2.0.0",
"2.1.0",
"2.1.1",
"2.1.2",
"2.2.0"
],
"BaselineVersion": "2.0.0",
Expand Down Expand Up @@ -4310,7 +4311,8 @@
"4.0.1.0": "4.3.0",
"4.0.2.0": "4.4.0",
"4.0.3.0": "4.5.0",
"4.0.3.1": "4.5.1"
"4.0.3.1": "4.5.1",
"4.0.3.2": "4.5.2"
}
},
"System.Security.Cryptography.Primitives": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private static Serializer GetSerializer(Type typeT, FieldInfo fieldInfo)
{
return (obj, writer) =>
{
using (AsnWriter tmp = new AsnWriter(AsnEncodingRules.DER))
using (AsnWriter tmp = new AsnWriter(writer.RuleSet))
{
serializer(obj, tmp);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
<ProjectReference Include="..\ref\CoreFx.Private.TestUtilities.csproj">
<SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\CoreFx.Private.TestUtilities.csproj"/>
<ProjectReference Include="..\src\CoreFx.Private.TestUtilities.csproj">
<SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
50 changes: 41 additions & 9 deletions src/System.Globalization.Calendars/tests/CalendarHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum DataType
Month = 2,
Day = 8
}

public static Calendar[] s_calendars = new Calendar[]
{
new ThaiBuddhistCalendar(),
Expand Down Expand Up @@ -55,6 +55,25 @@ private static int MaxCalendarYearInEra(Calendar calendar, int era)
return calendar.GetYear(calendar.ToDateTime(1, 1, 1, 0, 0, 0, 0, era + 1).AddDays(-1)) + 1;
}

// Get the max year in the passed era plus the sum of the max year for each subsequent era
private static int MaxCalendarYearInEras(Calendar calendar, int era)
{
int[] eras = calendar.Eras;
Assert.InRange(era, 0, eras[0]);
if (eras.Length == 1 || era == eras[0] || era == 0)
{
return MaxCalendarYearInEra(calendar, era);
}

int year = 0;
for (int i = era; i <= calendar.Eras[0]; i++)
{
year += MaxCalendarYearInEra(calendar, i);
}

return year;
}

private static int MaxGregorianYearInEra(Calendar calendar, int era)
{
int[] eras = calendar.Eras;
Expand Down Expand Up @@ -92,7 +111,8 @@ public static IEnumerable<object[]> Calendars_TestData()
{
foreach (Calendar calendar in s_calendars)
{
yield return new object[] { calendar };
if (!(calendar is JapaneseLunisolarCalendar) || !PlatformDetection.IsFullFramework)
yield return new object[] { calendar };
}
}

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

yield return new object[] { calendar, MaxCalendarYearInEras(calendar, era) + 1, month, day, era, "year" };

if ((type & DataType.Month) != 0)
{
Expand Down Expand Up @@ -158,7 +179,7 @@ public static IEnumerable<object[]> DateTime_TestData()
DateTime maxDate = calendar.MaxSupportedDateTime;
if (maxDate != DateTime.MaxValue)
{
yield return new object[] { calendar, maxDate.AddDays(1) };
yield return new object[] { calendar, maxDate.AddDays(1) };
}
}
}
Expand Down Expand Up @@ -334,7 +355,7 @@ public static void ToDateTime_Invalid(Calendar calendar)
// Year is invalid
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(-1, month, day, hour, minute, second, millisecond, era));
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(0, month, day, hour, minute, second, millisecond, era));
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(MaxCalendarYearInEra(calendar, era) + 1, month, day, hour, minute, second, millisecond, era));
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(MaxCalendarYearInEras(calendar, era) + 1, month, day, hour, minute, second, millisecond, era));

// Month is invalid
Assert.Throws<ArgumentOutOfRangeException>(() => calendar.ToDateTime(year, -1, day, hour, minute, second, millisecond, era));
Expand Down Expand Up @@ -388,7 +409,7 @@ public static void ToFourDigitYear_Invalid(Calendar calendar)
{
AssertExtensions.Throws<ArgumentOutOfRangeException>("year", () => calendar.ToFourDigitYear(-1));
AssertExtensions.Throws<ArgumentOutOfRangeException>("year", () => calendar.ToFourDigitYear(MaxCalendarYearInEra(calendar, MaxEra(calendar)) + 1));

if (!(calendar is JapaneseLunisolarCalendar))
{
AssertExtensions.Throws<ArgumentOutOfRangeException>("year", () => calendar.ToFourDigitYear(MinCalendarYearInEra(calendar, MinEra(calendar)) - 2));
Expand Down Expand Up @@ -460,5 +481,16 @@ public static void GetDayOfWeek_Invalid(Calendar calendar, DateTime dt)
AssertExtensions.Throws<ArgumentOutOfRangeException>("time", () => calendar.GetDayOfWeek(dt));
}
}

[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public static void TestJapaneseCalendarDateParsing()
{
CultureInfo ciJapanese = new CultureInfo("ja-JP") { DateTimeFormat = { Calendar = new JapaneseCalendar() } };

DateTime dt = new DateTime(1970, 1, 1);
string eraName = dt.ToString("gg", ciJapanese);
Assert.Equal(new DateTime(1995, 1, 1), DateTime.Parse(eraName + " 70/1/1 0:00:00", ciJapanese));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using Xunit;

namespace System.Globalization.Tests
{
public static class CalendarTests
{
[Fact]
public static void TestJapaneseCalendarDateParsing()
{
CultureInfo ciJapanese = new CultureInfo("ja-JP") { DateTimeFormat = { Calendar = new JapaneseCalendar() } };

DateTime dt = new DateTime(1970, 1, 1);
string eraName = dt.ToString("gg", ciJapanese);

// Legacy behavior which we used to throw when using a year number exceeding the era max year.
Assert.ThrowsAny<FormatException>(() => DateTime.Parse(eraName + " 70/1/1 0:00:00", ciJapanese));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{77BE33BB-790D-4D0C-9336-E073001CBD15}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="CalendarTests.cs" />
</ItemGroup>
<PropertyGroup>
<!--
We are overriding the .json config file to include "Switch.System.Globalization.EnforceJapaneseEraYearRanges": true
-->
<SkipXunitRuntimeConfigCopying>true</SkipXunitRuntimeConfigCopying>
</PropertyGroup>
<ItemGroup>
<Content Include="xunit.console.netcore.runtimeconfig.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"runtimeOptions": {
"configProperties": {
"Switch.System.Globalization.EnforceJapaneseEraYearRanges": true
},
"framework": {
"name": "Microsoft.NETCore.App",
"version": "9.9.9"
}
}
}
2 changes: 1 addition & 1 deletion src/System.IO.Pipelines/dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.0.0.1</AssemblyVersion>
<PackageVersion>4.5.2</PackageVersion>
<PackageVersion>4.5.3</PackageVersion>
<AssemblyKey>Open</AssemblyKey>
</PropertyGroup>
</Project>
5 changes: 5 additions & 0 deletions src/System.IO.Pipelines/pkg/System.IO.Pipelines.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
</ProjectReference>
<ProjectReference Include="..\src\System.IO.Pipelines.csproj" />
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
7 changes: 6 additions & 1 deletion src/System.Memory/pkg/System.Memory.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<PackageVersion>4.5.1</PackageVersion>
<PackageVersion>4.5.2</PackageVersion>
</PropertyGroup>
<ItemGroup>
<PackageIndex Include="$(ProjectDir)\pkg\baseline\packageBaseline.1.1.json" />
Expand All @@ -12,5 +12,10 @@
<ProjectReference Include="..\src\System.Memory.csproj" />
<InboxOnTargetFramework Include="netcoreapp2.1" />
</ItemGroup>
<PropertyGroup>
<!-- Excluding the reference assets on the package so that RAR will see the run-time conflicts at build time in order to
generate the right binding redirects when targeting Desktop. https://github.com/dotnet/corefx/issues/32457 -->
<ExcludeReferenceAssets>true</ExcludeReferenceAssets>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
2 changes: 1 addition & 1 deletion src/System.Net.Http.WinHttpHandler/dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.0.3.1</AssemblyVersion>
<PackageVersion>4.5.1</PackageVersion>
<PackageVersion>4.5.2</PackageVersion>
<AssemblyKey>MSFT</AssemblyKey>
</PropertyGroup>
</Project>
Loading

0 comments on commit de33b6e

Please sign in to comment.