Skip to content

Parallel compilation of scripts#19649

Open
majocha wants to merge 5 commits intodotnet:mainfrom
majocha:parallelcompilation-fsx
Open

Parallel compilation of scripts#19649
majocha wants to merge 5 commits intodotnet:mainfrom
majocha:parallelcompilation-fsx

Conversation

@majocha
Copy link
Copy Markdown
Contributor

@majocha majocha commented Apr 27, 2026

Graph based type checking did not handle compilations that include script files.
Previous workaround was to simply sequentially check files up to the last script on the sources list.

The actual bug was that graph checking did not record modules implicitly provided by any script file in the compilation, in effect missing dependencies like :

// A.fsx
let value = 41
// B.fsx
#load "A.fsx"
let result = A.value + 1

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

@majocha
Copy link
Copy Markdown
Contributor Author

majocha commented Apr 27, 2026

So, the diamondAssembly test is the only failing one.

Interestingly, the failure is not a new one, looking at git history: 90c4e66

@majocha
Copy link
Copy Markdown
Contributor Author

majocha commented May 4, 2026

The issue is caused by singling out AnonModule during trie mapping. If we want to be correct, we need to collect AnonModules that loaded script files implicitly provide.

@majocha majocha force-pushed the parallelcompilation-fsx branch from 0803290 to fb40499 Compare May 4, 2026 09:35

allDependencies

// If there is a script in the project, we just process sequentially all the files that may have been added as part of the script closure.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is the removed ugly workaround.

mkSingletonDict name { Current = current; Children = node } |> continuation)
tail

if kind = SynModuleOrNamespaceKind.AnonModule then
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does removing this special case break anything? Let's see.

@majocha majocha marked this pull request as ready for review May 4, 2026 15:22
@majocha majocha requested a review from a team as a code owner May 4, 2026 15:22
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.

1 participant