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

Netstandard2 #6814

Merged
merged 4 commits into from
May 25, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 0 additions & 21 deletions FSharp.Profiles.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,22 @@
<PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
<DefineConstants Condition="'$(MonoPackaging)' == 'true'">$(DefineConstants);CROSS_PLATFORM_COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
<DefineConstants>$(DefineConstants);BE_SECURITY_TRANSPARENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_LCIDFROMCODEPAGE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.StartsWith('netstandard')) OR $(TargetFramework.StartsWith('netcoreapp'))">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_APP_DOMAINS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BEGINEND_READWRITE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BINARY_SERIALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CORHOST_SIGNER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EVENTWAITHANDLE_IDISPOSABLE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_LINKEDRESOURCES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_READER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_WRITER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_MODULE_HANDLES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_ONLY</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SECURITY_PERMISSIONS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SERVERCODEPAGES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SYMBOLSTORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONFIGURATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_THREADABORT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WAITONE_MILLISECONDS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WEB_CLIENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WIN_REGISTRY</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WINFORMS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_INDENTED_TEXT_WRITER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_REDUCED_EXCEPTIONS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFEMIT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_GLOBALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_MSBUILD</DefineConstants>
<OtherFlags>$(OtherFlags) --simpleresolution</OtherFlags>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ restore:

build: proto restore
$(DotNetExe) build-server shutdown
$(DotNetExe) build -c $(Configuration) -f netstandard1.6 src/fsharp/FSharp.Core/FSharp.Core.fsproj
$(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Core/FSharp.Core.fsproj
$(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Build/FSharp.Build.fsproj
$(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp2.1 src/fsharp/fsc/fsc.fsproj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <!-- Tests won't run without this, at least on OSX, see https://github.com/NuGet/Home/issues/4837#issuecomment-354536302 -->
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
<DefineConstants>$(DefineConstants);NO_PROJECTCRACKER</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\ReshapedReflection.fs">
<Link>ReshapedReflection.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\FsUnit.fs">
<Link>FsUnit.fs</Link>
</Compile>
Expand Down
7 changes: 3 additions & 4 deletions fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<DefineConstants>$(DefineConstants);FX_NO_SYMBOLSTORE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_LINKEDRESOURCES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_APP_DOMAINS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_WIN_REGISTRY</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONFIGURATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFEMIT</DefineConstants>
Expand Down Expand Up @@ -67,9 +66,6 @@
<Compile Include="$(FSharpSourcesRoot)/fsharp/Logger.fs">
<Link>Logger.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/utils/reshapedreflection.fs">
<Link>Reshaped/reshapedreflection.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/utils/sformat.fsi">
<Link>ErrorText/sformat.fsi</Link>
</Compile>
Expand Down Expand Up @@ -157,6 +153,9 @@
<Compile Include="$(FSharpSourcesRoot)/absil/bytes.fs">
<Link>Utilities/bytes.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/XmlAdapters.fs">
<Link>Utilities\XmlAdapters.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/lib.fs">
<Link>Utilities/lib.fs</Link>
</Compile>
Expand Down
15 changes: 0 additions & 15 deletions src/absil/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ open System.Reflection
open System.Threading
open System.Runtime.CompilerServices

#if FX_RESHAPED_REFLECTION
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

// Logical shift right treating int32 as unsigned integer.
// Code that uses this should probably be adjusted to use unsigned integer types.
let (>>>&) (x: int32) (n: int32) = int32 (uint32 x >>> n)
Expand Down Expand Up @@ -258,12 +254,6 @@ module Option =

module List =

//let item n xs = List.nth xs n
#if FX_RESHAPED_REFLECTION
open PrimReflectionAdapters
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

let sortWithOrder (c: IComparer<'T>) elements = List.sortWith (Order.toFunction c) elements

let splitAfter n l =
Expand Down Expand Up @@ -1272,11 +1262,6 @@ type LayeredMultiMap<'Key, 'Value when 'Key : equality and 'Key : comparison>(co
[<AutoOpen>]
module Shim =

#if FX_RESHAPED_REFLECTION
open PrimReflectionAdapters
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

type IFileSystem =

/// A shim over File.ReadAllBytes
Expand Down
17 changes: 0 additions & 17 deletions src/absil/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ open FSharp.Compiler.ErrorLogger
open FSharp.Compiler.Range
open FSharp.Core.Printf

#if FX_RESHAPED_REFLECTION
open Microsoft.FSharp.Core.ReflectionAdapters
#endif

let codeLabelOrder = ComparisonIdentity.Structural<ILCodeLabel>

// Convert the output of convCustomAttr
Expand Down Expand Up @@ -314,10 +310,8 @@ let convAssemblyRef (aref: ILAssemblyRef) =
asmName.Version <- System.Version (int32 version.Major, int32 version.Minor, int32 version.Build, int32 version.Revision)
Option.iter setVersion aref.Version
// asmName.ProcessorArchitecture <- System.Reflection.ProcessorArchitecture.MSIL
#if !FX_RESHAPED_GLOBALIZATION
//Option.iter (fun name -> asmName.CultureInfo <- System.Globalization.CultureInfo.CreateSpecificCulture name) aref.Locale
asmName.CultureInfo <- System.Globalization.CultureInfo.InvariantCulture
#endif
asmName

/// The global environment.
Expand Down Expand Up @@ -663,9 +657,6 @@ let TypeBuilderInstantiationT =
ty

let typeIsNotQueryable (ty: Type) =
#if FX_RESHAPED_REFLECTION
let ty = ty.GetTypeInfo()
#endif
(ty :? TypeBuilder) || ((ty.GetType()).Equals(TypeBuilderInstantiationT))
//----------------------------------------------------------------------------
// convFieldSpec
Expand Down Expand Up @@ -794,11 +785,7 @@ let queryableTypeGetMethod cenv emEnv parentT (mref: ILMethodRef) =
parentT.GetMethod(mref.Name, cconv ||| BindingFlags.Public ||| BindingFlags.NonPublic,
null,
argTs,
#if FX_RESHAPED_REFLECTION
(null: obj[]))
#else
(null: ParameterModifier[]))
#endif
// This can fail if there is an ambiguity w.r.t. return type
with _ -> null
if (isNonNull methInfo && equalTypes resT methInfo.ReturnType) then
Expand Down Expand Up @@ -1434,11 +1421,7 @@ let buildGenParamsPass1 _emEnv defineGenericParameters (gps: ILGenericParameterD


let buildGenParamsPass1b cenv emEnv (genArgs: Type array) (gps: ILGenericParameterDefs) =
#if FX_RESHAPED_REFLECTION
let genpBs = genArgs |> Array.map (fun x -> (x.GetTypeInfo() :?> GenericTypeParameterBuilder))
#else
let genpBs = genArgs |> Array.map (fun x -> (x :?> GenericTypeParameterBuilder))
#endif
gps |> List.iteri (fun i (gp: ILGenericParameterDef) ->
let gpB = genpBs.[i]
// the Constraints are either the parent (base) type or interfaces.
Expand Down
3 changes: 0 additions & 3 deletions src/absil/ilwrite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3035,9 +3035,6 @@ module FileSystemUtilites =
open System
open System.Reflection
open System.Globalization
#if FX_RESHAPED_REFLECTION
open Microsoft.FSharp.Core.ReflectionAdapters
#endif
let progress = try System.Environment.GetEnvironmentVariable("FSharp_DebugSetFilePermissions") <> null with _ -> false
let setExecutablePermission (filename: string) =

Expand Down
3 changes: 0 additions & 3 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5247,11 +5247,8 @@ let CheckSimulateException(tcConfig: TcConfig) =
| Some("tc-oom") -> raise(System.OutOfMemoryException())
| Some("tc-an") -> raise(System.ArgumentNullException("simulated"))
| Some("tc-invop") -> raise(System.InvalidOperationException())
#if FX_REDUCED_EXCEPTIONS
#else
| Some("tc-av") -> raise(System.AccessViolationException())
| Some("tc-nfn") -> raise(System.NotFiniteNumberException())
#endif
| Some("tc-aor") -> raise(System.ArgumentOutOfRangeException())
| Some("tc-dv0") -> raise(System.DivideByZeroException())
| Some("tc-oe") -> raise(System.OverflowException())
Expand Down
6 changes: 0 additions & 6 deletions src/fsharp/CompileOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1604,16 +1604,10 @@ let ReportTime (tcConfig:TcConfig) descr =
| Some("fsc-oom") -> raise(System.OutOfMemoryException())
| Some("fsc-an") -> raise(System.ArgumentNullException("simulated"))
| Some("fsc-invop") -> raise(System.InvalidOperationException())
#if FX_REDUCED_EXCEPTIONS
#else
| Some("fsc-av") -> raise(System.AccessViolationException())
#endif
| Some("fsc-aor") -> raise(System.ArgumentOutOfRangeException())
| Some("fsc-dv0") -> raise(System.DivideByZeroException())
#if FX_REDUCED_EXCEPTIONS
#else
| Some("fsc-nfn") -> raise(System.NotFiniteNumberException())
#endif
| Some("fsc-oe") -> raise(System.OverflowException())
| Some("fsc-atmm") -> raise(System.ArrayTypeMismatchException())
| Some("fsc-bif") -> raise(System.BadImageFormatException())
Expand Down
8 changes: 0 additions & 8 deletions src/fsharp/ErrorLogger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,6 @@ module ErrorLoggerExtensions =

/// Reraise an exception if it is one we want to report to Watson.
let ReraiseIfWatsonable(exn:exn) =
#if FX_REDUCED_EXCEPTIONS
ignore exn
()
#else
match exn with
// These few SystemExceptions which we don't report to Watson are because we handle these in some way in Build.fs
| :? System.Reflection.TargetInvocationException -> ()
Expand All @@ -366,7 +362,6 @@ module ErrorLoggerExtensions =
PreserveStackTrace exn
raise exn
| _ -> ()
#endif

type ErrorLogger with

Expand Down Expand Up @@ -404,10 +399,7 @@ module ErrorLoggerExtensions =
// Throws StopProcessing and exceptions raised by the DiagnosticSink(exn) handler.
match exn with
(* Don't send ThreadAbortException down the error channel *)
#if FX_REDUCED_EXCEPTIONS
#else
| :? System.Threading.ThreadAbortException | WrappedError((:? System.Threading.ThreadAbortException), _) -> ()
#endif
| ReportedError _ | WrappedError(ReportedError _, _) -> ()
| StopProcessing | WrappedError(StopProcessing, _) ->
PreserveStackTrace exn
Expand Down
2 changes: 0 additions & 2 deletions src/fsharp/ExtensionTyping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ module internal ExtensionTyping =

let StripException (e: exn) =
match e with
#if !FX_REDUCED_EXCEPTIONS
| :? System.Reflection.TargetInvocationException as e -> e.InnerException
#endif
| :? TypeInitializationException as e -> e.InnerException
| _ -> e

Expand Down
1 change: 0 additions & 1 deletion src/fsharp/FSharp.Build/FSharp.Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<InternalsVisibleTo Include="VisualFSharp.UnitTests" />
<EmbeddedText Include="FSBuild.txt" />
<Compile Include="..\..\utils\CompilerLocationUtils.fs" />
<Compile Include="..\..\utils\reshapedreflection.fs" />
<Compile Include="FSharpCommandLineBuilder.fs" />
<Compile Include="Fsc.fs" />
<Compile Include="Fsi.fs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

<ItemGroup>
<EmbeddedText Include="..\FSInteractiveSettings.txt" />
<Compile Include="..\..\utils\reshapedreflection.fs" />
<Compile Include="..\fsiattrs.fs" />
<Compile Include="..\fsiaux.fsi" />
<Compile Include="..\fsiaux.fs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@
<Compile Include="..\Logger.fs">
<Link>Logger.fs</Link>
</Compile>
<Compile Include="..\..\utils\reshapedreflection.fs">
<Link>Reflection\reshapedreflection.fs</Link>
</Compile>
<Compile Include="..\..\utils\reshapedmsbuild.fs">
<Link>Reflection\reshapedmsbuild.fs</Link>
</Compile>
<Compile Include="..\..\utils\sformat.fsi">
<Link>ErrorText\sformat.fsi</Link>
</Compile>
Expand Down Expand Up @@ -157,6 +151,9 @@
<Compile Include="..\..\absil\bytes.fs">
<Link>Utilities\bytes.fs</Link>
</Compile>
<Compile Include="..\XmlAdapters.fs">
<Link>Utilities\XmlAdapters.fs</Link>
</Compile>
<Compile Include="..\InternalCollections.fsi">
<Link>Utilities\InternalCollections.fsi</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<id>FSharp.Compiler.Private.netcore</id>
<description>
.NET Core compatible version of the fsharp compiler service dll
Supported Platforms: - .NET Core (netstandard1.6)
Supported Platforms: - .NET Core (netstandard2.0)
</description>
<language>en-US</language>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand All @@ -15,7 +15,7 @@
<tags>$tags$</tags>
<dependencies>
<group>
<dependency id="NETStandard.Library" version="1.6.0" />
<dependency id="NETStandard.Library" version="2.0.0" />
<dependency id="System.Collections.Immutable" version="1.5.0" />
<dependency id="System.Diagnostics.Process" version="4.1.0" />
<dependency id="System.Diagnostics.TraceSource" version="4.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
<!-- assemblies -->
<file src="fsc\$Configuration$\netcoreapp2.1\fsc.exe" target="lib\netcoreapp2.1" />
<file src="fsi\$Configuration$\netcoreapp2.1\fsi.exe" target="lib\netcoreapp2.1" />
<file src="FSharp.Core\$Configuration$\netstandard1.6\FSharp.Core.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Compiler.Private\$Configuration$\netstandard2.0\FSharp.Compiler.Private.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\FSharp.Build.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Compiler.Interactive.Settings\$Configuration$\netstandard2.0\FSharp.Compiler.Interactive.Settings.dll"
target="lib\netcoreapp2.1" />
<!-- symbols -->
<file src="fsc\$Configuration$\netcoreapp2.1\fsc.pdb" target="lib\netcoreapp2.1" />
<file src="fsi\$Configuration$\netcoreapp2.1\fsi.pdb" target="lib\netcoreapp2.1" />
<file src="FSharp.Core\$Configuration$\netstandard1.6\FSharp.Core.pdb" target="lib\netcoreapp2.1" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.pdb" target="lib\netcoreapp2.1" />
<file src="FSharp.Compiler.Private\$Configuration$\netstandard2.0\FSharp.Compiler.Private.pdb" target="lib\netcoreapp2.1" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\FSharp.Build.pdb" target="lib\netcoreapp2.1" />
<file src="FSharp.Compiler.Interactive.Settings\$Configuration$\netstandard2.0\FSharp.Compiler.Interactive.Settings.pdb"
Expand All @@ -67,7 +67,7 @@
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\Microsoft.FSharp.Overrides.NetSdk.targets" target="contentFiles\any\any" />

<!-- resources -->
<file src="FSharp.Core\$Configuration$\netstandard1.6\**\FSharp.Core.resources.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\**\FSharp.Core.resources.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Compiler.Private\$Configuration$\netstandard2.0\**\FSharp.Compiler.Private.resources.dll"
target="lib\netcoreapp2.1" />
<file src="FSharp.Compiler.Interactive.Settings\$Configuration$\netstandard2.0\**\FSharp.Compiler.Interactive.Settings.resources.dll"
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PreRelease>true</PreRelease>
<TargetFrameworks>net45;netstandard1.6</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<PackageId>FSharp.Core</PackageId>
<NuspecFile>FSharp.Core.nuspec</NuspecFile>
<IsPackable>true</IsPackable>
Expand Down
Loading