-
Notifications
You must be signed in to change notification settings - Fork 123
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
Projects out of process (new api) #470
Projects out of process (new api) #470
Conversation
This aims to fix many problems stemming from two main issues: * FCS depends on MSBuild v12, and not all machines have this installed. * It's hard to apply robust assembly redirects, as this is up to the application referencing FCS. These are needed to redirect MSBuild v4 to whatever is being used (for custom MSBuild tasks), and also to allow redirecting to MSBuild v14 if necessary. The API is preserved, with an additional function, `GetProjectOptionsFromProjectFileLogged` to allow easier access to the logs for presentation to users and bug-reporting. The functionality is implemented by FCS calling a new console application, FSharp.Compiler.Service.ProjectCracker.exe, and the response is transmitted via serialization using JSON to types shared by a common source file, so there is no binary dependency between the two. The ProjectCracker static links to FSharp.Core, as it is in the same directory as FCS.dll. Thus bundling a separate copy would force the choice of version on all users of FCS, which is not acceptable.
Removes the project cracking from FCS.dll completely. Moves it into a new dll/exe pair that live in a new NuGet package. This breaks the FCS API, but a clean break. |
This is largely working, but somehow I've run into the same problem with the type provider tests as before! Very frustrating! Last time it seemed to be fixed by https://github.com/rneatherway/FSharp.Compiler.Service/commit/9c577b2aa979c1ea3d96a4caddeedb12b1ff3889, but I'm not sure what is going on now. |
let opts = fmt.Deserialize(p.StandardOutput.BaseStream) :?> FSharp.Compiler.Service.ProjectCracker.Exe.ProjectOptions | ||
p.WaitForExit() | ||
|
||
convert opts, opts.LogOutput |
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.
Is the log output collected for each project cracked? Looks like this just collects the first one, not any sub projects log files.
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.
You're right, it does. What would be better? Perhaps a Map from project filenames to log output?
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 that sounds fine, I can envisage problems where a referenced project
was causing an error which was masked due to only the parent log being
returned.
On 30 November 2015 at 14:29, Robin Neatherway [email protected]
wrote:
In src/fsharp/FSharp.Compiler.Service.ProjectCracker/Program.fs
#470 (comment)
:
arguments.Append(' ').Append(k).Append(' ').Append(v) |> ignore
let p = new System.Diagnostics.Process()
p.StartInfo.FileName <- Path.Combine(Path.GetDirectoryName(Reflection.Assembly.GetExecutingAssembly().Location),
"FSharp.Compiler.Service.ProjectCracker.Exe.exe")
p.StartInfo.Arguments <- arguments.ToString()
p.StartInfo.UseShellExecute <- false
p.StartInfo.CreateNoWindow <- true
p.StartInfo.RedirectStandardOutput <- true
ignore <| p.Start()
let fmt = new Serialization.Formatters.Binary.BinaryFormatter()
let opts = fmt.Deserialize(p.StandardOutput.BaseStream) :?> FSharp.Compiler.Service.ProjectCracker.Exe.ProjectOptions
p.WaitForExit()
convert opts, opts.LogOutput
You're right, it does. What would be better? Perhaps a Map from project
filenames to log output?—
Reply to this email directly or view it on GitHub
https://github.com/fsharp/FSharp.Compiler.Service/pull/470/files#r46148480
.
@rneatherway The errors are also strangely different in AppVeyor and Travis |
<Reference Include="Microsoft.Build.Utilities.v4.0" /> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | ||
<Private>True</Private> |
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.
You have two FSHarp.Core references, one with Private true and one with Private false. I assume that is problematic?
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.
AHA! Thanks so much for looking, that at least fixed the tests locally on Linux. I was scouring the project files looking for things like last time, but missed this somehow. Removing the Private true version was needed.
Previously only the top project was available. Also fix NuGet package
Still to do:
|
No other parts use it. The API looks acceptable to me - any remaining concerns there? |
Re 4.0 - I think we should just remove it and see who complains. Whoever requires it can probably sit on the older nuget packages for a long time. |
@7sharp9: This also fixes #455. I've had to put an ugly workaround for the Mono 4.2 xbuild bug. @DavidKarlas is that going to be backed out? |
@rneatherway Note #462 (comment) - Moving to Mono 4.2.1 has injected some failures into our tests. Is this what you're working around? thanks |
@rneatherway Change that caused problems for F# in 4.2 was reverted for 4.2, before final 4.2 was released, so there should be no problems with 4.2... |
@dsyme @DavidKarlas Mono 4.2 has changed the behaviour so that the Should I be doing this in a different way for the new version of Mono? |
@rneatherway Any idea what's causing the AppVeyor errors? Looks like path normalization problems? I'd love to get this merged and I think we're quite close? |
@dsyme I actually think it's a project configuration issue. When I compile the ProjectCrackerExe project on Windows with either MSbuild 12 or 14 I get:
|
Hmm, looks like there are duplicate entries further down. Must have been a dodgy merge at some point. |
Fantastic. Let's merge this? |
I'll merge this, let's clean up any further problems as we go. |
Projects out of process (new api)
No description provided.