-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Added TryParse to StandardFormat #33687
Added TryParse to StandardFormat #33687
Conversation
7601574
to
08a69cb
Compare
cc: @ahsonkhan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but I believe the change should be made in the coreclr repo first (which get mirrored to corefx). We can expose the new API from System.Memory ref and add the test here (i.e. corefx).
src/System.Memory/tests/ParsersAndFormatters/StandardFormatTests.cs
Outdated
Show resolved
Hide resolved
Yep, no worries. It is a bit tricky since the implementation is in CoreLib.
The file is included within CoreLib as part of System.Private.CoreLib (coming from coreclr), but exposed from System.Memory reference assembly:
Here are the steps I would follow:
To test your changes locally:
See this for more details: https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md#testing-with-private-coreclr-bits Feel free to ask any questions you may have and I will try to help. |
As an example, look at these two PRs that recently added a new API to CoreLib which was exposed from System.Runtime:
And here is the auto-gen mirror PR: The only difference here is that the API you are adding is being exposed from System.Memory. |
@ahsonkhan Thank you very much for your help and constructive feedback :) Now the things getting much clearer for me. |
Sounds good. This doc provides more context that could be useful to you: |
…changes to ref and tests
@dotnet-bot test this please |
1 similar comment
@dotnet-bot test this please |
@dotnet-bot test Linux x64 Release Build |
@dotnet-bot test this please |
@dotnet-bot test Linux x64 Release Build @ahsonkhan Do you know what is going wrong here? |
@dotnet-bot test Windows x64 Debug Build |
Yes, this should be fixed. Here is the cause/context:
The fix:
If you are up for it, the fix shouldn't be too difficult. There might be some if/defs or netstandard specific test code you would have to remove. Let me know if you need any help or get blocked. You can test locally by building and testing while targeting netfx (https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md): Notice the failure occurs only when building the test project:
|
Oh I was not so far away. I already opened this file corefx/src/System.Memory/src/Configurations.props earlier and played a bit around with adding Btw: Wasn't the idea to make this API a And thank you again :) |
@ahsonkhan Stuck again :-/ After removing Also with no success building with |
Once you have removed netstandard from So, it failing to build/run for that configuration is expected, and isn't something that needs to be fixed. You can only pass in |
🤦♂️ |
* Added TryParse to StandardFormat * Removed Obsolete from StandardFormat.Parse(string) * checked out the non changed StandardFormat.cs and made the suggested changes to ref and tests * Removed netstandard from BuildConfigurations
* Added TryParse to StandardFormat * Removed Obsolete from StandardFormat.Parse(string) * checked out the non changed StandardFormat.cs and made the suggested changes to ref and tests * Removed netstandard from BuildConfigurations Commit migrated from dotnet/corefx@c4eb0f0
Fixes issue #32950
Need help for this. I didn't get it exactly how all these parts work together.
Like I see, there is src/System.Memory/ref/System.Memory.cs, where the "abstraction" is defined and the src/Common/src/CoreLib/System/Buffers/StandardFormat.cs, but this file has no *.sln or *.csproj. But as you can see regardless of the changes I made the build fails.