-
Notifications
You must be signed in to change notification settings - Fork 301
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
Temp csproj gererated by fable break ionide exntension #3719
Comments
@MangelMaxime where is the temp csproj being generated? I think the safest thing to do here would be to evaluate the fsproj and get the value of the IntermediateOutputPath, then put your generated csproj inside that location. That location is typically hidden from most editor tooling and shouldn't impact the parent project. Separately, why have a csproj at all? What specifically was buildalyzer not doing for fsharp projects? |
@baronfel The temporary So you end up with:
Please takes my history explanations with precaution, I only followed it by reading the PR names or things like that at the time ^^ The origin of why we do that is because at some point Fable had trouble with .NET 7. I think it was using ProjInfo for the parsing but it had issues or missing information when new version of .NET came out. So Alfonso switched to using buildanalyzer. However, the problem with buildanalyzer is that it is/was really slow against fsproj file. This is what lead to a lot of issues about Fable 3 not supporting .NET 7 because it was "freezing". So Alfonso had the idea of using a temporary There has been discussion on moving the temporary Something that has been suggested is that with .NET 8, MSbuild now offer access to the "Design Time tasks or information". Which means that we should be able to ask MsBuild the information we needs. If I am not mistaken the information we are trying to access are: projOpts,
Seq.toArray result.ProjectReferences,
result.Properties,
result.TargetFramework Just by reading the code, I am unsure what projOpts are but here is the place where we retrieve the information we want for Fable Fable/src/Fable.Compiler/ProjectCracker.fs Lines 614 to 767 in b898fb6
I also believe that the A temporary workaround, could be to invoke This is a temporary solution while we investigate how to not use the |
Hi @Fubuchi, in the latest version (4.12.2) you can pass |
I tried to build with |
Description
During the compilation process, fable creates a temporary
csproj
file and runs thedotnet restore
on this file.This action might pull an old
FSharp.Core
version and cause errors in the editor if the F# code uses newer features.Here is an example of my
fsproj
The list of dependencies from the generated csproj
Notice the
FSharp.Core
version is 4.7.2 while it should be 8.x.x since I am using net SDK 8.That causes the ionide extension complaints where ever I use string interpolation since it is a F# 5 feature.
I need to run
dotnet restore
after compile fable to correct the F# version.Another workaround is adding
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
and<PackageReference Include="FSharp.Core" Version="8.0.101" />
to the fsproj so the generated csproj contains the desired F# versionExpected and actual results
The generated csproj and compilation process should not affect editor toolings.
Related information
The text was updated successfully, but these errors were encountered: