refactor(@angular/build): add NG_BUILD_CACHE_STORE environment variable support#33518
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to force a specific persistent cache store (either SQLite or LMDB) using the NG_BUILD_CACHE_STORE environment variable. It adds the configuration option, integrates it into the cache store creation logic, and includes corresponding unit tests. A review comment points out that the test assertion logic for LMDB initialization failures is too permissive and can swallow actual test failures if the assertion message contains the word 'lmdb'. It is recommended to restrict the error check to only ignore genuine initialization failures.
…le support This change introduces the `NG_BUILD_CACHE_STORE` environment variable to allow users and developers to customize the backing persistent cache storage mechanism. Usage: By default, the build system automatically uses the native LMDB cache store and falls back to the built-in SQLite cache store if LMDB fails to initialize. Users can now explicitly control this behavior by setting `NG_BUILD_CACHE_STORE` to one of the following values: - `sqlite`: Forces the use of the built-in SQLite cache store. No attempts to load the native LMDB store will be made. - `lmdb`: Forces the use of the native LMDB cache store. If the LMDB store fails to initialize, the build will fail. - `auto` / unset: Standard behavior (attempts LMDB first, falls back to SQLite). Example: $ NG_BUILD_CACHE_STORE=sqlite ng build
ec6600d to
8e370ed
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This change introduces the
NG_BUILD_CACHE_STOREenvironment variable to allow users and developers to customize the backing persistent cache storage mechanism.Usage:
By default, the build system automatically uses the native LMDB cache store and falls back to the built-in SQLite cache store if LMDB fails to initialize. Users can now explicitly control this behavior by setting
NG_BUILD_CACHE_STOREto one of the following values:sqlite: Forces the use of the built-in SQLite cache store. No attempts to load the native LMDB store will be made.lmdb: Forces the use of the native LMDB cache store. If the LMDB store fails to initialize, the build will fail.auto/ unset: Standard behavior (attempts LMDB first, falls back to SQLite).Example:
$ NG_BUILD_CACHE_STORE=sqlite ng build