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

Reference S.P.CoreLib from the facades#12187

Merged
jkotas merged 2 commits intodotnet:masterfrom
jkotas:CoreLib
Oct 5, 2016
Merged

Reference S.P.CoreLib from the facades#12187
jkotas merged 2 commits intodotnet:masterfrom
jkotas:CoreLib

Conversation

@jkotas
Copy link
Copy Markdown
Member

@jkotas jkotas commented Sep 29, 2016

Build facades for CoreCLR directly against S.P.CoreLib - similar to how they are built for CoreRT.

@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Sep 29, 2016

@weshaggard PTLA. The changes build fine with mscorlib.dll removed from CoreCLR targeting pack.

MembersMustExist : Member 'System.Type.IsSecurityTransparent.get()' does not exist in the implementation but it does exist in the contract.
Total Issues: 3
MembersMustExist : Member 'System.Type.GetType(System.String, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly>, System.Func<System.Reflection.Assembly, System.String, System.Boolean, System.Type>)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Type.GetType(System.String, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly>, System.Func<System.Reflection.Assembly, System.String, System.Boolean, System.Type>, System.Boolean)' does not exist in the implementation but it does exist in the contract.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Building against implementation uncovered several APIs missing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Which implementation is missing these?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

They are missing in CoreCLR System.Private.CoreLib, but they are present in the CoreCLR targeting pack mscorlib.dll.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good that we caught this can we make sure there is an issue filed to get them exposed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@stephentoub
Copy link
Copy Markdown
Member

Thanks for doing this, Jan.

FYI, there are some clash errors:

Error : Multiple projects built twice with the same target path D:\j\workspace\windows_nt_de---4526f5ff\bin\Windows_NT.AnyCPU.Debug\System.IO.FileSystem\System.IO.FileSystem.dll.
D:\j\workspace\windows_nt_de---4526f5ff\build.proj -->
  Global Properties:
    OSGroup = Windows_NT
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
D:\j\workspace\windows_nt_de---4526f5ff\src\dirs.proj -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\src.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.IO.FileSystem\src\System.IO.FileSystem.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.IO.FileSystem\src\System.IO.FileSystem.csproj
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    OSGroup = Windows_NT

D:\j\workspace\windows_nt_de---4526f5ff\build.proj -->
  Global Properties:
    OSGroup = Windows_NT
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
D:\j\workspace\windows_nt_de---4526f5ff\src\dirs.proj -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\src.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Diagnostics.StackTrace\src\System.Diagnostics.StackTrace.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Diagnostics.StackTrace\src\System.Diagnostics.StackTrace.csproj -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    BuildAllProjects = true
    InputOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.IO.FileSystem\src\System.IO.FileSystem.csproj
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    BuildAllProjects = true
    InputOSGroup = Windows_NT


Error : Multiple projects built twice with the same target path D:\j\workspace\windows_nt_de---4526f5ff\bin\Windows_NT.AnyCPU.Debug\System.Runtime.Extensions\System.Runtime.Extensions.dll.
D:\j\workspace\windows_nt_de---4526f5ff\build.proj -->
  Global Properties:
    OSGroup = Windows_NT
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
D:\j\workspace\windows_nt_de---4526f5ff\src\dirs.proj -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\src.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\src\System.Runtime.Extensions.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    OSGroup = Windows_NT

D:\j\workspace\windows_nt_de---4526f5ff\build.proj -->
  Global Properties:
    OSGroup = Windows_NT
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
D:\j\workspace\windows_nt_de---4526f5ff\src\dirs.proj -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\src.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Diagnostics.StackTrace\src\System.Diagnostics.StackTrace.builds -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    DefaultBuildAllTarget = Build
    BuildAllProjects = true
    InputOSGroup = Windows_NT
    FilterToOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Diagnostics.StackTrace\src\System.Diagnostics.StackTrace.csproj -->
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    BuildAllProjects = true
    InputOSGroup = Windows_NT
D:\j\workspace\windows_nt_de---4526f5ff\src\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj
  Global Properties:
    TargetOS = Windows_NT
    ConfigurationGroup = Debug
    WithoutCategories = IgnoreForCI
    BuildAllProjects = true
    InputOSGroup = Windows_NT

@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Sep 29, 2016

I have fixed the binclash errors. @weshaggard also mentioned before that there may be packaging issues that will need fixing ... not sure what to look for.

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net463_Release|AnyCPU'" />
<ItemGroup Condition="'$(IsPartialFacadeAssembly)'=='true'">
<TargetingPackReference Include="mscorlib" />
<TargetingPackReference Include="mscorlib" Condition="'$(TargetGroup)' == 'net463'" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can actually remove these TargetingPackReference's to the core assembly they should default to System.Private.CoreLib if that is present, See https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks/PackageFiles/packageresolve.targets#L148. You could also explicitly setTargetingPackCoreAssembly property if needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

When I remove the TargetingPackReference for System.Private.CoreLib, it does not build anymore.

Removing TargetingPackReference for mscorlib works fine - I will do that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmmm, the TargetingPackReference for mscorlib is set in like hundreds more files than what I am touching in this change. I will do it as a follow sweep PR to remove it from everywhere.

<OSGroup>Unix</OSGroup>
</Project>
<Project Include="System.Diagnostics.Debug.Tests.csproj">
<TestTFMs>netcore50;netcoreapp1.0;net46</TestTFMs>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What prompted this split? TestTFM isn't factored into the global build options and so you are essentially building this twice in the same configuration. TestTFMs is only about which things to run.

</ProjectReference>
<ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj" />
<TargetingPackReference Include="System.Private.CoreLib" Condition="'$(TestTFM)' != 'net46'" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We shouldn't condition things like this in the test project on TestTFM. If we need to make this test project have a TargetGroup net46 configuration. It is just pure accident that these ever worked when running on net46 (assuming they actually do work there).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The white-box part of the tests could not ever work on net46. I have excluded them for TargetGroup net46 configuration.

</ProjectReference>
<ProjectReference Include="..\..\System.Runtime\src\redist\System.Runtime.depproj">
<TargetGroup>netcore50</TargetGroup>
<ProjectReference Include="..\..\System.Collections\src\System.Collections.csproj" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is going to break the netcore50 builds, so we either need to fork these based on that configuration or we need to remove that build configuration completely. If we remove it means we will essentially harvest that configuration from the last stable package and reship that same binary for those configs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The netcore50 build configuration did not exist in the .builds file, even before my change. Is there anything that needs fixing?

Comment thread src/System.IO/src/System.IO.csproj Outdated
<TargetingPackReference Include="System.Private.Interop" />
<ValidateIgnoreReference Include="@(TargetingPackReference)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'net462' and '$(TargetGroup)' != 'net463' and '$(TargetGroup)' != 'netcore50aot' and '$(TargetGroup)' != 'netstandard13aot'">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For this project in particular I think I would just remove the TargetPackReference for System.Private.CoreLib which will eliminate the need for this crazy long condition here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have simplified the condition - to match the pattern used in other places. I have also removed the early CoreRT netstandard13aot config - it was unused and bit-rotten.

@@ -0,0 +1,4 @@
Compat issues with assembly System.Reflection:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these CoreCLR or CoreRT issues? If they are for both then keep the file named like this but if it is just one or the other please update the name of the baseline file to add a ".uap101" or "netstandard1.3" at the end.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These are CoreCLR issues. If I rename the file to netstandard1.3 at the end, it does not get picked up and the build fails. I see the file without suffix to be used everywhere else to track CoreCLR issues - I do not see why it should be different here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like this doesn't have a netstandard1.3 build just a netstandard1.7 build. The reason we try to make these target specific is so that we don't end up masking work in other configurations. In this case I suspect that these are missing from CoreCLR and CoreRT so using the common name should be fine because we likely need to fix both.

Just for context here is the logic where we pick the ApiCompatBaseline file name https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks/PackageFiles/ApiCompat.targets#L6.

<ProjectReference Include="..\..\System.ObjectModel\src\redist\System.ObjectModel.depproj">
<TargetGroup>netcore50</TargetGroup>
</ProjectReference>
<ProjectReference Include="..\..\System.Runtime\src\redist\System.Runtime.depproj">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to stack trace I think this will break netcore50 builds.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is no netcore50 build for this one...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a netcore50aot build, we should either remove that or change it to uap101 because otherwise the changes to this project may fail if they get picked up by .NET Native. We should probably make the System.ObjectModel consistent here as well to go with a straight csproj reference like System.Runtime.

Actually looking at the package this is one of the cases where we end up using the netstandard1.3 assets for netcore50 so this change will break that configuration. In which case we either need to bump this to netstandard1.7 or explicitly add a netcore50 build.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have bumped the default build to netstandard1.7 and fixed System.ObjectModel to be consistent.

I am trying not to change anything about netcore50aot build in this change. There are number of other projects that have netcore50aot build that have risk of not mixing well with shipped .NET Native. @SedarG is cleaning it up one assembly at a time.

<Compile Include="System\Threading\Tasks\TaskExtensions.CoreRT.cs" />
<ProjectReference Include="..\..\System.Runtime\src\redist\System.Runtime.depproj" />
<TargetingPackReference Include="System.Private.CoreLib" />
<TargetingPackReference Include="System.Private.CoreLib.Threading" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't this break? As I would expect it to still need the System.Private.CoreLib.Threading for the netcore50aot build configuration.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah.. looks like that build configuration doesn't even exist in the .builds file so we can probably remove all these or convert them to uap101 configuration and add that configuration in the .builds file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are multiple things broken that would need to be fixed to get this to build again for uap101aot. @SedarG has been working through them one .dll at a time - I will leave to him to deal with and re-enable.

@weshaggard
Copy link
Copy Markdown
Member

I have fixed the binclash errors. @weshaggard also mentioned before that there may be packaging issues that will need fixing ... not sure what to look for.

The packaging issue here is that we need to be sure that all the existing platforms don't break as our packages need to be backwards compatible. For example anything netcore50 build configuration still needs to be reference mscorlib otherwise when someone installs our latest packages in UWP they will break for UWP F5 scenarios because there only mscorlib exists. So we have 2 options to deal with that problem:

  1. We remove the netcore50 build configurations which will cause the older versions from our last stable packages to be reshipped, and so they will still be reference mscorlib.
  2. We add more conditions in these build files make the netcore50 builds still target mscorlib.

I'm leaning toward option (1) but the one downside of that option is that if we ever did need to fix something for those libraries we would either need to do it in a servicing branch or retroactively add that build configuration for the library in question. We are doing this in other scenarios so I still feel option (1) is the best way to go.

@jkotas jkotas force-pushed the CoreLib branch 3 times, most recently from 4fdc17a to b826477 Compare September 30, 2016 15:57
@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Sep 30, 2016

I agree with option (1) as well. There is no way we can maintain the matrix working live given how many changes are being made for the netstandard20 work.

I went over all packages that I am touching and made sure that they do not build netcore50 TargetGroup. I assume that I do not need to add uap101 TargetGroup if the regular CoreCLR flavor works fine - it is what was done in other places. All other feedback is incorporated as well. @weshaggard Could you please take a look?

<AssemblyName>System.Diagnostics.Tools</AssemblyName>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.3</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.7</NuGetTargetMoniker>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note this was just bumped in #11986. That PR will give you an indication of some of the things that change as part of the bump.

<AssemblyName>System.Diagnostics.Contracts</AssemblyName>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.0</NuGetTargetMoniker>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.7</NuGetTargetMoniker>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

whenever you bump this you will need to minimally update the associated project.json version otherwise you will see a bunch of warnings about them not finding this version. I also expect that you will likely need to make some updates to the pkgproj. @ericstj if we don't change assembly version but just bump the standard version shouldn't that hit some package validation issues?

@jkotas jkotas force-pushed the CoreLib branch 5 times, most recently from 572d9a9 to ff226c1 Compare October 1, 2016 20:11
@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Oct 2, 2016

@weshaggard This should be complete now. Could you please take a look one more time?

@jkotas
Copy link
Copy Markdown
Member Author

jkotas commented Oct 4, 2016

@dotnet-bot test Innerloop CentOS7.1 Release Build and Test please

@jkotas jkotas force-pushed the CoreLib branch 2 times, most recently from 33c4435 to 65702e3 Compare October 4, 2016 15:51
@jkotas jkotas merged commit c407bf9 into dotnet:master Oct 5, 2016
@jkotas jkotas deleted the CoreLib branch October 5, 2016 07:07
@karelz karelz modified the milestone: 1.2.0 Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Reference S.P.CoreLib from the facades

Commit migrated from dotnet/corefx@c407bf9
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