-
-
Notifications
You must be signed in to change notification settings - Fork 591
Description
Expected behavior
Projectile should not treat the home directory as a Bazel project when only a ~/workspace directory exists (and no WORKSPACE file).
Actual behavior
Projectile incorrectly recognizes the home directory (/Users/foo/) as a Bazel project even though there is no WORKSPACE file directly under $HOME.
When a directory named ~/workspace exists, running M-x projectile-project-info shows:
Project dir: /Users/foo/
Project VCS: none
Project type: bazel
If I rename ~/workspace to something else (e.g. ~/workspaces), then $HOME is no longer treated as a project.
This seems to be a side effect of macOS’s case-insensitive filesystem, which makes workspace and WORKSPACE indistinguishable in certain checks.
It causes Projectile to falsely identify $HOME as a Bazel project, even though no marker file exists.
As a result, Projectile treats the entire home directory as a project, leading to severe performance degradation in downstream environments (e.g. Spacemacs, pet-mode) when opening files under $HOME.
Steps to reproduce the problem
- On macOS, create a directory named
~/workspace - Start Emacs with Projectile enabled
- Execute
M-x projectile-project-info - Observe that the home directory is recognized as a Bazel project
- Rename
~/workspace→~/workspacesand see that the issue disappears
Additional notes
This issue causes significant performance problems downstream (see syl20bnr/spacemacs#17142 and related reports).
In my case, simply opening a Python file under $HOME can take several minutes if Projectile misidentifies $HOME as a project.
Environment & Version information
Projectile version
Projectile version: 20250704.908
Emacs version
GNU Emacs 30.1
Operating system
macOS 13.7.8.1