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

FCS + PowerTools breaking F# Formatting #510

Closed
tpetricek opened this issue Jan 12, 2016 · 6 comments
Closed

FCS + PowerTools breaking F# Formatting #510

tpetricek opened this issue Jan 12, 2016 · 6 comments

Comments

@tpetricek
Copy link
Member

I seem to be repeatedly getting into issues when I update F# Formatting to use a new version of Visual F# PowerTools and F# Compiler service.

Most recently, I started getting the following error when referencing F# Formatting from the FsSnip project (https://github.com/tpetricek/FsSnip.Website):

System.TypeInitializationException: The type initializer for '<StartupCode$FSI_0001>.$FSI_0001_App$fsx' threw an exception. ---> 
System.TypeInitializationException: The type initializer for 'FSI_0001.FsSnip.Snippet' threw an exception. ---> 
System.TypeInitializationException: The type initializer for '<StartupCode$FSI_0001>.$FSI_0001_FsSnip.Snippet' threw an exception. ---> 
System.TypeInitializationException: The type initializer for 'FSI_0001.FsSnip.Utils' threw an exception. ---> 
System.TypeInitializationException: The type initializer for '<StartupCode$FSI_0001>.$FSI_0001_FsSnip.Utils' threw an exception. ---> 
System.MissingMethodException: Method not found: 'Void Microsoft.FSharp.Compiler.SourceCodeServices.FSharpChecker.set_ImplicitlyStartBackgroundWork(Boolean)'.

at FSharpVSPowerTools.LanguageService..ctor(FSharpOption1 backgroundCompilation, FSharpOption1 projectCacheSize, FSharpOption`1 fileSystem)

It was only happening inside Azure (I was suspecting wrong F# Core reference?) but it started working when I downgraded F# Compiler service to 1.4.2 (see this change). I do not really see why, because the method exists in the newest version too and it does not reference any F# Core types.

I think there might be more general issue here though because FSharpVSPowerTools.Core package references FSharp.Compiler.Service (≥ 1.4.2), but I think what it really means is that it needs exactly 1.4.2 because newer versions of F# Compiler Service often break compatibility.

@matthid @dsyme @vasily-kirichenko @dungpa What should we do here?

Should F# Compiler Service not have breaking changes within sub-versions? Or should PowerTools have a fixed-version dependency? Or am I missing something?

@matthid
Copy link
Contributor

matthid commented Jan 12, 2016

The problem is that both projects don't really have developed a versioning story jet, so it's hard to depend on them properly (at least I didn't saw any definition anywhere when which number gets increased for either project, I think @dsyme suggested somewhere to switch to semver which would be very welcome). I don't think including breaking changes in the last version number is a good idea no matter the versioning story.

This is definitly related to fsprojects/FSharp.Formatting#337 in the sense that even when we (FSF) pin the versions it wouldn't help currently in all situations :). All projects referencing FCS feel quite versatile at the moment (even more when FAKE is involved).

@dsyme
Copy link
Contributor

dsyme commented Jan 12, 2016

FCS can now use SemVer.

The 1.4.2 series is meant to be binary compatible - it would be good to determine why it isn't and what we can do to test compat.

At least it appears 1.4.2.0 and 1.4.2.3 were not binary compatible from what you say above. However the error message points the finger at set_ImplicitlyStartBackgroundWork, but this was added in 1.4.0.9 with this change

@matthid
Copy link
Contributor

matthid commented Jan 13, 2016

Without actually reproducing anything this is probaly in fact another instance of fsprojects/FSharp.Formatting#337 and there is no bug here at FCS.

@tpetricek while you downgraded FCS you also upgraded FAKE from 4.4.1 bundling FCS 1.4.0.1 to 4.14.0 bundling FCS 1.4.2.1. Note that 1.4.0.1 doesn't contain the method while 1.4.2.1 does. You can simply verify this by unlocking FCS in the paket.dependences file and after updating FCS it should still work.

@forki Thank you for giving us lockfiles 👍

Related fsprojects/Paket#1381 its definitly a problem across all the three projects (FAKE, Paket, FSF)

@tpetricek
Copy link
Member Author

Aaah, I think it is FAKE update as @matthid says.

I wonder if FAKE could use some AppDomain magic when running the scripts to make sure it is not preventing us from loading another version of FCS?

@matthid
Copy link
Contributor

matthid commented Jan 14, 2016

I think this needs to be a FCS feature. But I don't know if it is worth to implement as everything is moving towards CoreCLR and it doesn't support AppDomains :(

@dsyme
Copy link
Contributor

dsyme commented Mar 30, 2016

Closing this as I don't see a specific fix we can make in FCS

@dsyme dsyme closed this as completed Mar 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants