Skip to content

Build a project's TcGlobals with its own path map when the framework imports are cached - #20476

Merged
abonie merged 5 commits into
dotnet:mainfrom
xperiandri:fix/framework-cache-pathmap
Oct 13, 2026
Merged

abonie merged 5 commits into
dotnet:mainfrom
xperiandri:fix/framework-cache-pathmap

Conversation

@xperiandri

@xperiandri xperiandri commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #20474

FrameworkImportsCache reused the --pathmap of the first project that filled the cache for every project sharing the same framework set. As a result, a project without a path map could expose path-mapped file names to its consumers, and a project with one could lose it. TcGlobals is now rebuilt when the path map differs.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Release notes checked


✅ Found changes and release notes in following paths:

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

xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 7, 2026
@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Sep 7, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 7, 2026
@xperiandri
xperiandri force-pushed the fix/framework-cache-pathmap branch from 54a06cf to 0c4b74a Compare September 7, 2026 12:52

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖🕵️ Approved; CI is still running.

@github-project-automation github-project-automation Bot moved this from New to In Progress in F# Compiler and Tooling Sep 7, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 11, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 11, 2026
@xperiandri
xperiandri force-pushed the fix/framework-cache-pathmap branch from 0c4b74a to 93a30a9 Compare September 11, 2026 16:17
@github-actions github-actions Bot added the ⚠️ Affects-Design-Time Tooling check: PR touches type providers or dependency manager label Sep 11, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

T-Gro
T-Gro previously requested changes Sep 15, 2026

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖🕵️ Please make the description more concise using this guidance. Keep the problem and why the change is needed prominent, using short sentences in simplified technical English. Retain necessary caveats.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Tooling Safety Check — Affects-Design-Time
Affects-Design-Time: Compiler service or Visual Studio behavior changed.

Generated by PR Tooling Safety Check · gpt56 1.9M · ◷

xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 26, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Sep 26, 2026
Copilot AI lite review requested due to automatic review settings September 26, 2026 01:00
@xperiandri
xperiandri force-pushed the fix/framework-cache-pathmap branch from 93a30a9 to ec062bd Compare September 26, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Add coverage for a mapped project after an unmapped sibling populates the cache.

Review effort: Lite
Findings: None

What changed in this PR

Fixes framework import cache reuse so each project’s TcGlobals retains its own path map.

Changes:

  • Rebuilds TcGlobals when pathMap differs.
  • Applies project-specific path maps in both compiler paths.
  • Adds regression coverage and release notes.
File Summary
tests/​FSharp.Compiler.ComponentTests/​FSharpChecker/​PathMap.fs Adds path-map cache regression tests.
tests/​FSharp.Compiler.ComponentTests/​FSharp.Compiler.ComponentTests.fsproj Includes the new test file.
src/​Compiler/​Service/​TransparentCompiler.fs Applies project-specific path maps.
src/​Compiler/​Service/​IncrementalBuild.fs Handles path-map differences in cached globals.
docs/​release-notes/​.FSharp.Compiler.Service/​11.0.100.md Documents the fix.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@xperiandri
xperiandri force-pushed the fix/framework-cache-pathmap branch from 768180c to be55d40 Compare October 2, 2026 16:03
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Oct 2, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Oct 2, 2026
@xperiandri
xperiandri force-pushed the fix/framework-cache-pathmap branch from be55d40 to 53d5378 Compare October 8, 2026 01:11
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Oct 8, 2026
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Oct 8, 2026

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 🕵️ Re-reviewed all recent changes as of 53d5378; LGTM

xperiandri and others added 4 commits October 10, 2026 23:39
…imports are cached

FrameworkImportsCache keys the framework imports, and the TcGlobals built
with them, by the framework set alone. A project reusing the entry got a
fresh TcGlobals only when langVersion or realsig differed, and even then took
pathMap from the cached instance. Since TypedTreePickle applies that map to
every range it writes, the in-memory reference data of each project carried
the --pathmap of whichever project filled the cache first, and a project
without a map handed its consumers file names nothing on disk matches.

pathMap now takes part in the decision like langVersion and realsig, and the
new TcGlobals takes it from the project's own TcConfig, in the incremental
builder and the transparent compiler alike.

Fixes dotnet#20474

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ing project

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`main` opened 11.0.200 for SDK 11.0.200; 11.0.100 has shipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@xperiandri
xperiandri force-pushed the fix/framework-cache-pathmap branch from 53d5378 to 340683f Compare October 10, 2026 22:28
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Oct 10, 2026
…lled the cache

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xperiandri added a commit to xperiandri/fsharp that referenced this pull request Oct 11, 2026
Takes the test that a project keeps its path map after a sibling without one
filled the cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@T-Gro T-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 🕵️ Re-reviewed all recent changes as of 46e85e2; LGTM

@abonie
abonie requested a review from T-Gro October 13, 2026 11:13
@abonie
abonie dismissed T-Gro’s stale review October 13, 2026 11:14

Requested change has been done imo

@abonie abonie added the AI-reviewed PR reviewed by AI review council label Oct 13, 2026
@abonie
abonie merged commit 59ea46d into dotnet:main Oct 13, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ Affects-Design-Time Tooling check: PR touches type providers or dependency manager AI-reviewed PR reviewed by AI review council AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

FrameworkImportsCache lends the first project's --pathmap to every project of the framework set

4 participants