-
Notifications
You must be signed in to change notification settings - Fork 803
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 use refassemblies switch to fsi #6585
Conversation
filename: string, sourceText:ISourceText, codeContext, useSimpleResolution: bool, | ||
useFsiAuxLib, lexResourceManager: Lexhelp.LexResourceManager, | ||
applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage): LoadClosure = | ||
(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, |
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.
lots of trailing whitespace
else | ||
struct (Int32.Parse(elements.[0]), Int32.Parse(elements.[1]), Int32.Parse(elements.[2]), getSuffix) | ||
|
||
let versionCompare c1 c2 = |
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.
Unit test this, because it could get nasty.
let executionTfm = | ||
let file = | ||
try | ||
let depsJsonPath = Path.ChangeExtension(Assembly.GetEntryAssembly().Location, "deps.json") |
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 is raising-then-catching exceptions on startup of desktop F# Interactive. SHould this code be executed for desktop fsi.exe at all?
path.StartsWith(appRefDir, StringComparison.OrdinalIgnoreCase) | ||
| _ -> false | ||
|
||
let getFrameworkRefsPackDirectory = |
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 looks like it should be a function rather than a computation. Also have ///
comments on all of these would be good please
String.CompareOrdinal(suffix2, suffix1) | ||
with _ -> 0 | ||
|
||
let executionTfm = |
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.
Add a ///
comment please, and avoid use of abbreviations like tfm
(TargetFrameworkMoniker for those wondering)
@@ -34,6 +34,98 @@ module internal FSharp.Compiler.DotNetFrameworkDependencies | |||
None | |||
with _ -> None | |||
|
|||
// Compare nuget version strings |
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.
Use a ///
comment please
@@ -3209,10 +3209,10 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten | |||
backgroundCompiler.KeepProjectAlive(options, userOpName) | |||
|
|||
/// For a given script file, get the ProjectOptions implied by the #load closure | |||
member ic.GetProjectOptionsFromScript(filename, sourceText, ?loadedTimeStamp, ?otherFlags, ?useFsiAuxLib, ?assumeDotNetFramework, ?extraProjectInfo: obj, ?optionsStamp: int64, ?userOpName: string) = | |||
member ic.GetProjectOptionsFromScript(filename, source, ?loadedTimeStamp, ?otherFlags, ?useFsiAuxLib, ?useSdkRefs, ?assumeDotNetFramework, ?extraProjectInfo: obj, ?optionsStamp: int64, ?userOpName: string) = |
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 is still showing as source
in the diff - were you going to change it back to sourceText
?
@@ -1458,3 +1458,4 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl | |||
3245,tcCopyAndUpdateNeedsRecordType,"The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record" | |||
3300,chkInvalidFunctionParameterType,"The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL." | |||
3301,chkInvalidFunctionReturnType,"The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL." | |||
useSdkRefs,"Use reference assemblies for DotNET framework references when available (Enabled by default))." |
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 is still showing DotNET
on github though you said you'd change it to .NET
in code review - was that done separately?
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.
It was not https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/FSComp.txt#L1461
@KevinRansom Let's queue up another PR here
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.
Oh I fixed it, it must have got lost somehow. As did the )) on the end of the line.
With DotNet Core 3.0, we will be shipping a set of reference assemblies that matches the default target framework for the shipped dotnet cli. The NetSdk team are updating the compile time build to make use of these.
This PR adds an additional switch to FSI, that will have fsi compile against this set of reference assemblies by default rather than the implementation assemblies.
This is important because with versions of the cli revving frequently and supporting multiple platforms, we want to ensure that scripts run against a consistent platform. Implementation assemblies may have a bigger public surface, and one that is not consistent across platforms or between versions.
E.g ..
Internal.Runtime.InteropServices.WindowsRuntime.ExceptionSupport is a public internal implementation type, that would be risky to rely on.
With this feature:
The dotnet framework contracts are defined by the framework definitions: DotNetStandard1.6 and up, and DotNetCoreApp1.0 and up and similar net461, net472 etc … not by the contents of any assemblies in the coreclr runtime directory.
Kevin