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

[WIP] Reuse typechecking results - stage 1 #17898

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

psfinaki
Copy link
Member

@psfinaki psfinaki commented Oct 18, 2024

First part of the implementation of reusing typecheck results, as per the design doc.

This basically does 2 things:

  • adds the flag --reusetypecheckingresults, with all the hooking
  • force-generates the typechecking graph and skips recompilation if it's unchanged

Open questions: see my comments.

Copy link
Contributor

github-actions bot commented Oct 18, 2024

❗ Release notes required


✅ Found changes and release notes in following paths:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/9.0.200.md No current pull request URL (#17898) found, please consider adding it

@psfinaki psfinaki changed the title Reuse typechecking results - stage 1 [WIP] Reuse typechecking results - stage 1 Oct 18, 2024
@@ -1961,7 +1961,54 @@ let CheckMultipleInputsUsingGraphMode

partialResults, tcState)

let TryReuseTypecheckingResults (tcConfig: TcConfig) inputs =
let tcDataFileName = FileSystem.GetFullPathShim "FSharpTypecheckingData"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably come from msbuild, via the value of the flag, and should be set to an intermediate output

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I need to resolve and set the proper location for the file here.

The name got inspiration for FSharpSignatureData and FSharpOptimizationData we already have, but it can be whatever.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vzarytovskii just so that I don't reinvent the wheel here - do you know if we already have a way to extract msbuild vars somewhere in the compiler?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so we discussed this with Kevin, outputDir should be enough here.

src/Compiler/Driver/fsc.fs Outdated Show resolved Hide resolved
@psfinaki psfinaki requested a review from T-Gro October 18, 2024 16:31
@psfinaki
Copy link
Member Author

@T-Gro PTAL, this is an early stage so I mostly just wanted to discuss the questions I raised in the comments, so that we go in the agreed direction.

@edgarfgp
Copy link
Contributor

It seems like this is going to rely/build on top of graph checking have couple questions:

@psfinaki
Copy link
Member Author

@edgarfgp so we'll need to discuss this - personally I'd like to turn graph-checking on. Now (like, before Xmas) is a rather good time - we can catch some bugs there before the next big release.

It's somewhat scaring but, well, just this probably shouldn't be stopping us 👀 Graph-checking and reusing typechecking results can test each other and I'd say we should use this benefit here.

I am not speaking for the whole team just yet - only sharing some thoughts. We will discuss and prioritize this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

4 participants