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

Conversation

@Anipik
Copy link

@Anipik Anipik commented Feb 13, 2018

Shared Coreclr Implementation PR - dotnet/coreclr#16334
Related to dotnet/corefx#395
Tests PR - #27051

@Anipik Anipik requested review from danmoseley and tarekgh February 13, 2018 19:36
{
throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this in the .csproj:
https://github.com/Anipik/corefx/blob/c9a7d5c3e4fb4a1ef5897cb0c03440044922a986/src/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj#L20-L21
and this should fail when built for netfx as the below overload doesn't exist there, but I see that build passed CI, and it looks like that's because we don't build this library for netfx:
https://github.com/Anipik/corefx/blob/c9a7d5c3e4fb4a1ef5897cb0c03440044922a986/src/System.Globalization.Extensions/src/Configurations.props#L5-L7
@tarekgh, is that just cruft that can be cleaned up?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we don't build netfx package for this library anymore. mainly most of the functionality are already exposed from somewhere else.

@Anipik we just need to delete all the cs files there and clean up the csproj files.


In reply to: 167985111 [](ancestors = 167985111)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarekgh can you please tell which files need to be removed ?

Copy link
Member

@tarekgh tarekgh Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please modify the code as suggested in the other comment. Thanks

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete all netfx conditions from this file.

public override int GetHashCode()
{
return _compareInfo.GetHashCode() ^ ((int)_options & 0x7FFFFFFF);
return StringComparer.Create(CultureInfo.GetCultureInfo(compareInfo.Name), options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still does not feel right to me to make this method many times slower with this change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarekgh any other things that we can do ?

Copy link
Member

@tarekgh tarekgh Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still does not feel right to me to make this method many times slower with this change.

I cannot think of any ready better solution rather than returning back the CultureAwareComparer here. the best we can do is to expose StringCompare.Create which takes a compare info. or we move the whole extension class to coelib

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the whole extension class to coelib

That would be my pick.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Anipik could you please move this extension class to corelib? thanks a lot for your effort here.

@jkotas do you want to keep this PR open till we move the extension class to corelib? or we can proceed with this PR and have another PR to fix that?

Another thing for this PR, could you please clean up the ref folder too corefx\src\System.Globalization.Extensions\ref?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotas should we move to corelib in this PR or in a different PR ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Anipik You may start creating the coreclr PR from now.

@tarekgh
Copy link
Member

tarekgh commented Feb 15, 2018

<OmitResources Condition="'$(TargetGroup)' != 'netfx'">true</OmitResources>

remove this condition


Refers to: src/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj:12 in b01ad32. [](commit_id = b01ad32, deletion_comment = False)

<Compile Include="System\Globalization\Extensions.cs" />
<Compile Include="System\StringNormalizationExtensions.netfx.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condition="'$(TargetGroup)' != 'netfx'" [](start = 13, length = 39)

remove this condition

@tarekgh
Copy link
Member

tarekgh commented Feb 15, 2018

remove this block


Refers to: src/System.Globalization.Extensions/src/System.Globalization.Extensions.csproj:31 in b01ad32. [](commit_id = b01ad32, deletion_comment = False)

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not building for netfx. All conditions for netfx can be deleted too.

@Anipik
Copy link
Author

Anipik commented Feb 21, 2018

@dotnet-bot test this please

@Anipik
Copy link
Author

Anipik commented Feb 21, 2018

@tarekgh @jkotas can you take a look at the changes ?

@tarekgh
Copy link
Member

tarekgh commented Feb 21, 2018

@Anipik I assume you have tested it with your private changes in coreclr. right?

<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Globalization\ref\System.Globalization.csproj" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can delete \..\System.Globalization\ref\System.Globalization.csproj line.

<ProjectGuid>{2B96AA10-84C0-4927-8611-8D2474B990E8}</ProjectGuid>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<OmitResources Condition="'$(TargetGroup)' != 'netfx'">true</OmitResources>
<OmitResources>true</OmitResources>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this line and also src\System.Globalization.Extensions\src\Resources\Strings.resx

<Reference Include="System.Diagnostics.Tools" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you just need System.Runtime and System.Runtime.Extensions here.

@Anipik
Copy link
Author

Anipik commented Feb 22, 2018

@tarekgh I have tested them locally also and new version of coreclr has also been updated in corefx.

@Anipik
Copy link
Author

Anipik commented Feb 22, 2018

@jkotas is it okay to merge it now ?

@jkotas jkotas merged commit 0fbb5f1 into dotnet:master Feb 22, 2018
@karelz karelz added this to the 2.1.0 milestone Mar 10, 2018
@Anipik Anipik deleted the removeStringComparer branch March 24, 2018 01:34
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants