-
Notifications
You must be signed in to change notification settings - Fork 772
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
Extension point for package manager. #2667
Conversation
tests/fsharpqa/Source/test.lst
Outdated
@@ -250,6 +250,7 @@ Misc01 EntryPoint | |||
Misc01 Globalization | |||
Misc01,NoMT Import | |||
Misc01,NoMT ..\..\..\testsprivate\fsharpqa\Source\InteractiveSession\AssemblyLoading | |||
Misc01,NoMT InteractiveSession\Paket |
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 one should point to UnkonwDependencyManager right?
Where would we need to put the packagemanager dll? |
Exciting! |
| Some kv -> ReferenceType.RegisteredDependencyManager kv.Value | ||
with | ||
| e -> | ||
errorR(Error(FSComp.SR.packageManagerError(e.Message),m)) |
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.
Maybe it wouldn't hurt to have the full stack trace?
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.
Yeah adding some stack trace would be helpful
ReferenceType.Library path | ||
| _ -> | ||
let managers = RegisteredDependencyManagers() | ||
match managers |> Seq.tryFind (fun kv -> path.StartsWith(kv.Value.Key + ":" )) with |
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.
We need to fix the lookup, didn't had chance to fix that in original PR but we are using a map, so we should lookup on the exact key rather than iteration.
@forki, currently, the directory containing the executing FSharp.Compiler.dll, or the BaseDirectory of the AppDomain or LoadContext, I.e the directory containing fsi.exe. |
I think that would not work for Fsi in VS. We can't guess that path from
paket install. We should decide to scan in some specific appdata path.
Am 21.03.2017 16:21 schrieb "Kevin Ransom (msft)" <notifications@github.com
…:
@forki <https://github.com/forki>, currently, the directory containing
the executing FSharp.Compiler.dll, or the BaseDirectory of the AppDomain or
LoadContext, I.e the directory containing fsi.exe.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2667 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNAX2XkNrVc9AhXQHEsZBj_qkTPazks5rn_kegaJpZM4MjSrr>
.
|
@forki / @KevinRansom there are few notes on that topic on the RFC: https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1027-fsi-references.md look for "Handler resolution" on it. |
How can we move forward here? |
@KevinRansom, I think we should keep some more iteration on @forki's branch, because having a paket-less version of this branch makes it harder to do real things with it, and we are losing important tests that found real issues along the way. I might resume the work some time next week to sketch an implementation for the "handler resolution", and I think working on the other branch makes most sense, what about you submitting patches to the other branch instead? Also, I think it would make sense for FSI to have the paket manager assembly since there is no hard dependency, just relying on paket.exe. The handler resolution also allow to override handler that we would be shipping out of the box. Any input? |
By all means, forki’s branch should be where you guys drive this feature. I need this so that I can start work on what it means for us. I would caution you to resolve the handler in as simple a manner as possible. We can add complexity, once we have some solid experience of the limitations of the most simplest scheme on multiple platforms in various scenarios.
|
@KevinRansom can you review the https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1027-fsi-references.md "Handler resolution" section to tell if you think it is too complicated and what you propose instead? |
I'm not sure I understand it, I got a bit confused between tool resolution and assembly resolution I thought I did then I lost my place, and sort of got confused. I think that the rules for #r assembly resolution can be quite simple though. CAVEAT: The current Windows FSI #r behavior needs to be unchanged on Windows, which makes me wonder about what follows. Perhaps a #newloader pragma to turn on this behavior
Kevin |
@smoothdeveloper BTW, the reason I hadn't pulled this was I was hoping to build a test that demonstrated that it worked, but got sidetracked by PDB work.. |
errorR(Error(FSComp.SR.packageManagerError(e.Message),m)) | ||
None | ||
|
||
let resolve (packageManager:IDependencyManagerProvider) implicitIncludeDir fileName m packageManagerTextLines = |
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.
Could we have /// comments on all new top-level let
, type
and module
please? thanks
I glanced over this, it's looking very good. What's the plan for adding more testing here? There's only one small negative test so far, and the feature PR should really be self-contained w.r.t. testing? Also is there any testing for the ref/impl split? |
let postSources = (!tcConfig).GetAvailableLoadedSources() | ||
let sources = if preSources.Length < postSources.Length then postSources.[preSources.Length..] else [] | ||
|
||
yield! resolveDependencyManagerSources filename |
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.
Why is resolveDependencyManagerSources
called twice?
// * to minimize footprint of integration in fsi/CompileOps | ||
|
||
/// hardcoded to net461 as we don't have fsi on netcore | ||
let targetFramework = "net461" |
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.
What's this, and does it need to be hard-coded?
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 remnant from hardcoded parameter we need to give in case of paket.
Notice that IDependencyManagerProvider.ResolveDependencies
takes a targetFramework parameter, which has been this value so far.
If we don't give a single framework, it makes it difficult for paket to identify which is intended framework.
I think this should come from tooling, similarly that we have an issue of intellisense always working with latest .net framework rather than having an user option to specify it.
@forki Can you update this when you get the chance? Thanks! |
? I had my own pull request. Not sure what Kevin did here |
Closing in favour of #4042 |
Is the package manager extension point from: #2483