fix(@angular/build): scope cache directory by project and builder name - #34240
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the validation check that prevents the library builder's output path from being the project root, containing the project root, or being located within the project root. The review feedback highlights that while allowing the output path to be within the project root is desirable, we must still prevent it from being exactly the project root or containing the project root to avoid accidental deletion of source files. Suggestions are provided to restore a modified validation check, retain the 'isSubDirectory' import, and reuse the resolved output path variable.
2c197db to
4bdbfa2
Compare
4bdbfa2 to
dd9bf8a
Compare
14dd9e5 to
ead7184
Compare
Accept optional `projectName` and `builderName` parameters in `normalizeCacheOptions` to consistently scope `path` and `localPath` per project and builder across the application, dev-server, library, ng-packagr, and unit-test builders. Without scoping the cache path by `builderName`, builders that invoke the application build pipeline (such as `unit-test` during `ng test` and `application` during `ng build`) share the same project cache directory and overwrite shared cache artifacts such as `.tsbuildinfo` files, preventing incremental caching from working properly.
ead7184 to
431414e
Compare
clydin
left a comment
There was a problem hiding this comment.
Looks like ng-packagr and unit-test already have some logic to add the builder name to the cache path. To avoid duplicate path segments, we should also remove/consolidate that logic.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Accept optional
projectNameandbuilderNameparameters innormalizeCacheOptionsto consistently scopepathandlocalPathper project and builder across theapplication,dev-server,library,ng-packagr, andunit-testbuilders.Without scoping the cache path by
builderName, builders such asng test(unit-test) andng build(application) share the same project cache directory and overwrite shared cache files such as.tsbuildinfo, causing incremental caching not to work properly.