-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Move serialization primitives to System.Runtime #10388
Move serialization primitives to System.Runtime #10388
Conversation
b89010e
to
d2c90a1
Compare
We need BinaryFormatter to be able to serialize types from coreclr that use the various serialization types (e.g. ISerializable), which means those types must have the same identity as the ones BinaryFormatter recognizes, and we need a bunch of types all across corefx to be able to use these same types to implement serialization. As such, the types are moving down to System.Runtime, and on coreclr, are type-forwarding to the implementations there. There are a few outstanding issues: - SR is not currently available in System.Runtime. The few uses of SR in the versions of the code used for corert have been replaced by hardcoded strings and TODOs. - Debug.Assert is not currently available in System.Runtime. Asserts have been commented out with TODOs. - To get things to build as types are moving around, P2P references are used.
d2c90a1
to
7812bc2
Compare
@@ -12,6 +12,8 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<None Include="project.json" /> | |||
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" /> |
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.
This will be broken after I merge my changes because now this reference will be to the 4.2 version of the assembly, but the implementation will still just get 4.1 causing a mismatch. To make this not break my code, could you try adding a target group on all of this P2P references? This will let you still reference the 4.1 version of the assembly after my change. This is more or less what I'm suggesting:
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj">
<TargetGroup>netstandard1.5</TargetGroup>
</ProjectReference>
I believe that if you do that, it will work before and after my change.
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.
@joperezr this is the ref which only has one build the latest netstandard1.7 version, so I think the ProjectReference @stephentoub has will work.
Same comments on the rest of P2P references |
@@ -12,6 +12,8 @@ | |||
</ItemGroup> |
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.
Given that you are depending on the netstandard1.7 version of System.Runtime you will also need to update the netstandard version of this library to match it.
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.
I am hitting a failure in CI, but only on Windows. Any idea how I fix this?
Error : Multiple projects built twice with the same target path D:\j\workspace\windows_nt_de---0cbbd14c\bin\ref\System.Runtime\4.1.1.0\System.Runtime.dll.
D:\j\workspace\windows_nt_de---0cbbd14c\build.proj -->
Global Properties:
ConfigurationGroup = Debug
OSGroup = Windows_NT
WithoutCategories = IgnoreForCI
D:\j\workspace\windows_nt_de---0cbbd14c\src\dirs.proj -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
DefaultBuildAllTarget = Build
BuildAllProjects = true
InputOSGroup = Windows_NT
FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\src.builds -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
DefaultBuildAllTarget = Build
BuildAllProjects = true
InputOSGroup = Windows_NT
FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\System.Runtime.Serialization.Primitives\src\System.Runtime.Serialization.Primitives.builds -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
DefaultBuildAllTarget = Build
BuildAllProjects = true
InputOSGroup = Windows_NT
FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\System.Runtime.Serialization.Primitives\src\System.Runtime.Serialization.Primitives.csproj -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
BuildAllProjects = true
InputOSGroup = Windows_NT
OSGroup = Windows_NT
TargetGroup = netcore50aot
D:\j\workspace\windows_nt_de---0cbbd14c\src\System.Runtime\ref\System.Runtime.csproj
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
BuildAllProjects = true
InputOSGroup = Windows_NT
OSGroup = Windows_NT
TargetGroup = netcore50aot
D:\j\workspace\windows_nt_de---0cbbd14c\build.proj -->
Global Properties:
ConfigurationGroup = Debug
OSGroup = Windows_NT
WithoutCategories = IgnoreForCI
D:\j\workspace\windows_nt_de---0cbbd14c\src\dirs.proj -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
DefaultBuildAllTarget = Build
BuildAllProjects = true
InputOSGroup = Windows_NT
FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\src.builds -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
DefaultBuildAllTarget = Build
BuildAllProjects = true
InputOSGroup = Windows_NT
FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\System.Collections\src\System.Collections.builds -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
DefaultBuildAllTarget = Build
BuildAllProjects = true
InputOSGroup = Windows_NT
FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\System.Collections\src\System.Collections.csproj -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
BuildAllProjects = true
InputOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\System.Runtime\src\System.Runtime.csproj -->
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
BuildAllProjects = true
InputOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---0cbbd14c\src\System.Runtime\ref\System.Runtime.csproj
Global Properties:
ConfigurationGroup = Debug
WithoutCategories = IgnoreForCI
BuildAllProjects = true
InputOSGroup = Windows_NT
MSBUILD : error MSB4015: The build stopped unexpectedly because the "ReusableLogger" logger failed unexpectedly during shutdown.
System.Exception: 1 bin clashes were detected during the build.
at Microsoft.DotNet.Build.Tasks.BinClashLogger.Shutdown()
at Microsoft.Build.Evaluation.ProjectCollection.ReusableLogger.Shutdown()
at Microsoft.Build.BackEnd.Logging.LoggingService.ShutdownLogger(ILogger logger)
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.
Well to be correct it will be netstandard1.7 after @joperezr merge but as is I think it should be netstandard1.5
Assigning this to me as I will be finishing up this work. |
Closing, since #10667 replaces this. |
Update UWP metapackage for servicing by updating S.R.Serialization.Json, S.R.Serialization.Xml, and additional packages listed in dotnet/corefx#10388.
We need BinaryFormatter to be able to serialize types from coreclr that use the various serialization types (e.g. ISerializable), which means those types must have the same identity as the ones BinaryFormatter recognizes, and we need a bunch of types all across corefx to be able to use these same types to implement serialization. As such, the types are moving down to System.Runtime, and on coreclr, are type-forwarding to the implementations there.
There are a few outstanding issues:
(Once this is in place, I'll be able to finish up deploying serialization throughout corefx; I have a partially completed local branch adding all of that in.)
cc: @weshaggard, @ericstj, @danmosemsft, @KrzysztofCwalina, @joperezr