-
Notifications
You must be signed in to change notification settings - Fork 789
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
Use process dependencies for fsi #6324
Conversation
Link #6215 |
if assumeDotNetFramework then | ||
getDependenciesOf (getDesktopDefaultReferences useFsiAuxLib) | ||
else | ||
// Coreclr supports netstandard assemblies only for now |
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.
Can we expand this to also include the closure of netcoreapp? This would allow things like span in scripting
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.
@cartermp
as discussed, here is using Span.
c:\kevinransom\visualfsharp>artifacts\toolset\dotnet\dotnet.exe artifacts\bin\fsi\Release\netcoreapp2.1\fsi.exe
Microsoft (R) F# Interactive version 10.2.3 for F# 4.5
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> // Learn more about F# at http://fsharp.org
open System
//[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
let t = Span.Empty
0 // return an integer exit code
let _ = main [| "Hello" |];;
Hello World from F#!
val main : argv:'a -> int
Span can't be a top level function in fsi. Perhaps we need to think about how that might look if we enabled it. Or may not.
538e86d
to
6f2c5bf
Compare
@dsyme, please take a look at this.
|
0bc31a0
to
368f54f
Compare
@KevinRansom can you verify this one works? #6215 |
|
So …
1:
with the current dotnet fsi command:
Yields an error:
This occurs because neither the dotnet cli doesn't list the implementation assembly that contains the netstandard 2.0 Apis for System.Diagnostics.Process.
This change recurses the dependencies of netstandard2.0 to collect all of the dependent assemblies, so we don't have to manually list out all of the dependent assemblies.
2:
Moves the implementation out into a separate source file DotnetFrameworkDependences.fs rather than smack in the middle of CompileOps.fs.
3:
COMPILER_SERVICE_ASSUMES_DOTNETCORE_COMPILATION is not used in this repo, or the CompilerService repo.
**** NOTE ****
In dotnet 3.0 FSI compile time references will be against reference assemblies not implementation assemblies. This PR continues our current behavior of using implementation assemblies. We are negotiating APIs that will make it possible for us to more easily find the correct reference assemblies in SDK installs.
Because the current implementation is against implementation assemblies, care must be taken when creating cross platform scripts. If you only use netstandard 2.0 Apis, in your scripts they will work well.
But you may see "Not Implemented exceptions" if you use an API that isn't implemented on all platforms.