Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a System.Runtime.Experimental package so users can still use the generic math preview #55678

Merged
merged 6 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/clr.featuredefines.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<FeaturePerfTracing>true</FeaturePerfTracing>
<FeatureTypeEquivalence>true</FeatureTypeEquivalence>
<FeatureBasicFreeze>true</FeatureBasicFreeze>
<FeatureGenericMath>false</FeatureGenericMath>
<FeatureGenericMath>true</FeatureGenericMath>
<ProfilingSupportedBuild>true</ProfilingSupportedBuild>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<IsNETCoreAppRef>false</IsNETCoreAppRef>
<IsNETCoreAppSrc>false</IsNETCoreAppSrc>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
</PropertyGroup>
</Project>
12 changes: 12 additions & 0 deletions src/libraries/System.Runtime.Experimental/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<configuration>
<!-- This disables restore in VS for projects that target platform specific target frameworks older than net5.0. -->
<packageRestore>
<!-- The 'automatic' key is set to True when the "Automatically check for missing packages during
build in Visual Studio" checkbox is set. Clearing the box sets this to False and disables
automatic restore. -->
<add key="automatic" value="False" />
<!-- The 'enabled' key is True when the "Allow NuGet to download missing packages" checkbox is set.
Clearing the box sets this to False, disabling command-line, automatic, and MSBuild-integrated restore. -->
<add key="enabled" value="False" />
</packageRestore>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Microsoft Visual Studio Solution File, Format Version 12.00
ericstj marked this conversation as resolved.
Show resolved Hide resolved
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.CoreLib", "..\..\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj", "{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.Experimental", "ref\System.Runtime.Experimental.csproj", "{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.Experimental.Tests", "tests\System.Runtime.Experimental.Tests.csproj", "{4EE36055-AD7C-4779-B3F6-08687960DCC3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{BDCC9986-D51F-48D9-9650-388E172CD91E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{F4F10B6C-21C0-4C9D-8909-76FC52145120}"
EndProject
Global
GlobalSection(NestedProjects) = preSolution
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9} = {C7032EBC-8AB7-4BE6-9D95-B420F058FAAF}
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C} = {F4F10B6C-21C0-4C9D-8909-76FC52145120}
{4EE36055-AD7C-4779-B3F6-08687960DCC3} = {BDCC9986-D51F-48D9-9650-388E172CD91E}
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
Checked|Any CPU = Checked|Any CPU
Checked|x64 = Checked|x64
Checked|x86 = Checked|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|Any CPU.ActiveCfg = Debug|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|Any CPU.Build.0 = Debug|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|x64.ActiveCfg = Debug|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|x64.Build.0 = Debug|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|x86.ActiveCfg = Debug|x86
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Debug|x86.Build.0 = Debug|x86
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|Any CPU.ActiveCfg = Release|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|Any CPU.Build.0 = Release|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|x64.ActiveCfg = Release|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|x64.Build.0 = Release|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|x86.ActiveCfg = Release|x86
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Release|x86.Build.0 = Release|x86
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|Any CPU.ActiveCfg = Checked|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|Any CPU.Build.0 = Checked|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x64.ActiveCfg = Checked|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x64.Build.0 = Checked|x64
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x86.ActiveCfg = Checked|x86
{71AB8240-F179-4B21-A8BE-8BE6CD774ED9}.Checked|x86.Build.0 = Checked|x86
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|x64.ActiveCfg = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|x64.Build.0 = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|x86.ActiveCfg = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Debug|x86.Build.0 = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|Any CPU.Build.0 = Release|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|x64.ActiveCfg = Release|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|x64.Build.0 = Release|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|x86.ActiveCfg = Release|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Release|x86.Build.0 = Release|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|x64.ActiveCfg = Debug|Any CPU
{F39E2C7E-5FE1-460C-AC2C-7E2B50955F2C}.Checked|x86.ActiveCfg = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|x64.ActiveCfg = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|x64.Build.0 = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|x86.ActiveCfg = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Debug|x86.Build.0 = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|Any CPU.Build.0 = Release|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|x64.ActiveCfg = Release|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|x64.Build.0 = Release|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|x86.ActiveCfg = Release|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Release|x86.Build.0 = Release|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|x64.ActiveCfg = Debug|Any CPU
{4EE36055-AD7C-4779-B3F6-08687960DCC3}.Checked|x86.ActiveCfg = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {19706846-1F47-42ED-B649-B0982EE96E6B}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
<PropertyGroup>
<AssemblyName>System.Runtime</AssemblyName>
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<FeatureGenericMath>true</FeatureGenericMath>
<!-- It is a core assembly because it defines System.Object so we need to pass RuntimeMetadataVersion to the compiler -->
<RuntimeMetadataVersion>v4.0.30319</RuntimeMetadataVersion>
Copy link
Member

Choose a reason for hiding this comment

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

can this value change?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't believe its meant to ever change. The project was largely copied identically from the main System.Runtime and new property/items are under their own groups.

Copy link
Member

Choose a reason for hiding this comment

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

It's meant to change whenever we change the assembly file format (like we did now for the static virtual methods). It would tell the old tools that the file is not compatible.

We haven't been changing the version despite doing breaking changes to the format in the hopes that things will "just work" for tools that don't know what the new things are. It sometimes works and sometimes it leads to obscure failure modes (like now for the C++ compiler in the presence of static virtuals).

<!-- disable warnings about obsolete APIs,
Remove warning disable when nullable attributes are respected,
Type has no accessible constructors which use only CLS-compliant types -->
<NoWarn>$(NoWarn);0809;0618;CS8614;CS3015</NoWarn>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(FeatureGenericMath)' == 'true'">$(DefineConstants);FEATURE_GENERIC_MATH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.cs" />
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>
<Target Name="_ExperimentalUpdateFileVersion"
AfterTargets="_InitializeAssemblyVersion">
<PropertyGroup>
<_FileVersionMaj>$(FileVersion.Split('.')[0])</_FileVersionMaj>
<_FileVersionMin>$(FileVersion.Split('.')[1])</_FileVersionMin>
<_FileVersionBld>$(FileVersion.Split('.')[2])</_FileVersionBld>
<_FileVersionRev>$(FileVersion.Split('.')[3])</_FileVersionRev>
</PropertyGroup>
<CreateProperty Value="$(_FileVersionMaj).$(_FileVersionMin).$([MSBuild]::Add($(_FileVersionBld), 100)).$(_FileVersionRev)">
<Output TaskParameter="Value" PropertyName="FileVersion" />
</CreateProperty>
</Target>
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>System.Runtime.Tests</AssemblyName>
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<FeatureGenericMath>true</FeatureGenericMath>
<NoWarn>$(NoWarn),1718,SYSLIB0013</NoWarn>
<TestRuntime>true</TestRuntime>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>
<Nullable>disable</Nullable>
<!-- Disable nullability public only feature for NullabilityInfoContextTests -->
<Features>$(Features.Replace('nullablePublicOnly', '')</Features>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(FeatureGenericMath)' == 'true'">$(DefineConstants);FEATURE_GENERIC_MATH</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\ByteTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\CharTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int16Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int32Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int64Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\IntPtrTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\SByteTests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt16Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt32Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt64Tests.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UIntPtrTests.cs" />
</ItemGroup>
<ItemGroup Condition="'$(FeatureGenericMath)' == 'true'">
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\ByteTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\CharTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\GenericMathHelpers.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int16Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int32Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\Int64Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\IntPtrTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\SByteTests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt16Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt32Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UInt64Tests.GenericMath.cs" />
<Compile Include="$(LibrariesProjectRoot)System.Runtime\tests\System\UIntPtrTests.GenericMath.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)TestUtilities.Unicode\TestUtilities.Unicode.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ CannotMakeMemberAbstract : Member 'public System.Boolean System.IO.FileSystemInf
CannotMakeMemberAbstract : Member 'public System.String System.IO.FileSystemInfo.Name.get()' is abstract in the reference but is not abstract in the implementation.
# C# generates backing fields for fixed buffers as public.
TypesMustExist : Type 'System.IO.Enumeration.FileSystemEntry.<_fileNameBuffer>e__FixedBuffer' does not exist in the reference but it does exist in the implementation.

tannergooding marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion src/libraries/System.Runtime/src/System.Runtime.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ContractProject>$(LibrariesProjectRoot)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj</ContractProject>
tannergooding marked this conversation as resolved.
Show resolved Hide resolved
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<!-- Compiler throws error if you try to use System.Void and instructs you to use void keyword instead. So we have manually added a typeforward for this type. -->
<!-- Compiler throws error if you try to use System.Void and instructs you to use void keyword instead. So we have manually added a typeforward for this type. -->
<GenFacadesOmitType Include="System.Void" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<FeatureMono>true</FeatureMono>
<FeatureManagedEtwChannels>true</FeatureManagedEtwChannels>
<FeatureManagedEtw>true</FeatureManagedEtw>
<FeatureGenericMath>false</FeatureGenericMath>
<FeatureGenericMath>true</FeatureGenericMath>
<FeaturePortableTimer Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableTimer>
<FeaturePortableThreadPool Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableThreadPool>
<FeaturePerfTracing Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePerfTracing>
Expand Down