FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Angular project in subfolder of Git worktree emits cache at root of main Git repo · Issue #34215 · angular/angular-cli · GitHub

Repository navigation

Angular project in subfolder of Git worktree emits cache at root of main Git repo #34215

Description

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

22.0.x

Description

With #33321, the Angular CLI now shares build caches between Git worktrees. However, I'm not sure that it's working as expected with Angular projects that live in folders deeper than the root of the repo.

My repo is a C# solution with 3 web apps using Angular, which looks something like this:

  • Solution/
    • Site1/
      • ClientApp/ (Angular project root)
    • Site2/
      • ClientApp/ (Angular project root)
    • Site3/
      • ClientApp/ (Angular project root)

After upgrading to Angular 22.1+, if I am on a Git worktree and build any of the Angular apps, the main repo gets new cache files at: `/.angular/cache//ClientApp/

Building the Angular projects in the main repo does not use the same cache. Those continue to use the caches at <repo root>/Site#/ClientApp/.angular/. Running ng cache info on an app in the main repo vs a worktree shows this discrepancy:

# From main repo folder
> npx ng cache info

Path              : C:\Path\To\Solution\Site1\ClientApp\.angular\cache

# From worktree folder
> npx ng cache info

Path              : C:\Path\To\Solution\.angular\cache

This feels unexpected for a few reasons:

  • All three unrelated sites are using the same cache, since they are all called ClientApp (due to ASP.NET convention)
  • The cache lives at the root of the main repo, even though there is no Angular project there
  • The main repo doesn't use the same cache location as the worktrees

Minimal Reproduction

mkdir Solution
git init

ng new --skip-git 
# use TestApp as app name for example

git add .
git commit -m "Initial commit"

git worktree add --detach ../Solution-worktree main
cd ../Solution-worktree/TestApp
npm i
npm run build

cd ../../Solution
git status
# Would expect no changes, but new untracked .angular folder with caches is present

Exception or Error

Your Environment

Angular CLI       : 22.2.0
Angular           : 22.2.0
Node.js           : 24.19.0
Package Manager   : npm 11.17.0
Operating System  : win32 x64

┌───────────────────────────────┬───────────────────┬───────────────────┐
│ Package                       │ Installed Version │ Requested Version │
├───────────────────────────────┼───────────────────┼───────────────────┤
│ @angular-devkit/architect     │ 0.2202.0          │ ^0.2202.0         │
│ @angular-devkit/build-angular │ 22.2.0            │ ^22.2.0           │
│ @angular-devkit/core          │ 22.2.0            │ ^22.2.0           │
│ @angular/aria                 │ 22.2.0            │ ^22.2.0           │
│ @angular/build                │ 22.2.0            │ ^22.2.0           │
│ @angular/cdk                  │ 22.2.0            │ ^22.2.0           │
│ @angular/cli                  │ 22.2.0            │ ^22.2.0           │
│ @angular/common               │ 22.2.0            │ ^22.2.0           │
│ @angular/compiler             │ 22.2.0            │ ^22.2.0           │
│ @angular/compiler-cli         │ 22.2.0            │ ^22.2.0           │
│ @angular/core                 │ 22.2.0            │ ^22.2.0           │
│ @angular/forms                │ 22.2.0            │ ^22.2.0           │
│ @angular/material             │ 22.2.0            │ ^22.2.0           │
│ @angular/platform-browser     │ 22.2.0            │ ^22.2.0           │
│ @angular/router               │ 22.2.0            │ ^22.2.0           │
│ @angular/upgrade              │ 22.2.0            │ ^22.2.0           │
│ rxjs                          │ 7.8.2             │ ~7.8.0            │
│ typescript                    │ 6.0.3             │ ~6.0.3            │
│ vitest                        │ 4.1.10            │ ^4.1.10           │
│ zone.js                       │ 0.15.1            │ ~0.15.0           │

Anything else relevant?

No response

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL