Skip to content

fix(case): apply using pnpm with store outside#63099

Closed
baymer wants to merge 1 commit intomicrosoft:mainfrom
baymer:fix-casesensitive-calculation
Closed

fix(case): apply using pnpm with store outside#63099
baymer wants to merge 1 commit intomicrosoft:mainfrom
baymer:fix-casesensitive-calculation

Conversation

@baymer
Copy link
Copy Markdown

@baymer baymer commented Feb 4, 2026

on mac filesystem is CaseInsensitive but repo mount is CaseSensitive and when pnpm has virtualStore outside, the typescript think that the system is CaseInsensitive, but it is CaseSensitive

to fix that we use pnpm-patch

diff --git a/lib/typescript.js b/lib/typescript.js
index 2643aa12aa6497ca0b90ecd99b202f37ea0e6330..34757f4fb1a2958bec5142c6e365c4214a2f36fb 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -8277,11 +8277,11 @@ var sys = (() => {
     const isLinuxOrMacOs = process.platform === "linux" || isMacOs;
     const statSyncOptions = { throwIfNoEntry: false };
     const platform = _os.platform();
+    const getCurrentDirectory = memoize(() => process.cwd());
     const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
     const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
     const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
     const fsSupportsRecursiveFsWatch = process.platform === "win32" || isMacOs;
-    const getCurrentDirectory = memoize(() => process.cwd());
     const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
       pollingWatchFileWorker: fsWatchFileWorker,
       getModifiedTime: getModifiedTime3,
@@ -8484,7 +8484,7 @@ var sys = (() => {
       if (platform === "win32" || platform === "win64") {
         return false;
       }
-      return !fileExists(swapCase(__filename));
+      return !fileExists(swapCase(getCurrentDirectory()));
     }
     function swapCase(s) {
       return s.replace(/\w/g, (ch) => {

may be the time to fix that in the upstream)

Fixes #63100

on mac filesystem is CaseInsensitive
but repo mount is CaseSensitive
and when pnpm has virtualStore outside, the typescript think that the system is CaseInsensitive, but it is CaseSensitive

to fix that we use pnpm-patch

```
diff --git a/lib/typescript.js b/lib/typescript.js
index 2643aa1..34757f4fb1a2958bec5142c6e365c4214a2f36fb 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -8277,11 +8277,11 @@ var sys = (() => {
     const isLinuxOrMacOs = process.platform === "linux" || isMacOs;
     const statSyncOptions = { throwIfNoEntry: false };
     const platform = _os.platform();
+    const getCurrentDirectory = memoize(() => process.cwd());
     const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
     const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
     const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
     const fsSupportsRecursiveFsWatch = process.platform === "win32" || isMacOs;
-    const getCurrentDirectory = memoize(() => process.cwd());
     const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
       pollingWatchFileWorker: fsWatchFileWorker,
       getModifiedTime: getModifiedTime3,
@@ -8484,7 +8484,7 @@ var sys = (() => {
       if (platform === "win32" || platform === "win64") {
         return false;
       }
-      return !fileExists(swapCase(__filename));
+      return !fileExists(swapCase(getCurrentDirectory()));
     }
     function swapCase(s) {
       return s.replace(/\w/g, (ch) => {
```

may be the time to fix that in the upstream)
@typescript-bot
Copy link
Copy Markdown
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 4, 2026
@baymer
Copy link
Copy Markdown
Author

baymer commented Feb 4, 2026

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

#63100

@jakebailey
Copy link
Copy Markdown
Member

I don't think this is the right kind of fix; it just moves the case check to an unspecified "current directory" which we largely do not have any control over and should very much always ignore

Copy link
Copy Markdown
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

I dont think this is right approach, You should look into where incorrect file casing is used as we did #56476 to somehow avoid this issue.

We cannot do "volume" wise casing as we arent currently equipped for that but we try to use "filenames" instead of "paths" which are lowercase file name on case-insensitive system.

@github-project-automation github-project-automation bot moved this from Not started to Waiting on author in PR Backlog Feb 4, 2026
@typescript-bot
Copy link
Copy Markdown
Collaborator

With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies).

Next steps for PRs:

  • For crash bugfixes or language service improvements, PRs are currently accepted at the typescript-go repo
  • Changes to type system behavior should wait until after 7.0, at which point mainline TypeScript development will resume in this repository with the Go codebase
  • Library file updates (lib.d.ts etc) continue to live in this repo or the DOM Generator repo as appropriate

@github-project-automation github-project-automation bot moved this from Waiting on author to Done in PR Backlog Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

TS wrong calculate case sensitive repo as case insensitive filesystem

4 participants