You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/0017-incremental-build.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,14 +236,13 @@ There are major differences in how those two types of build manifests are handle
236
236
237
237
#### Build Signature
238
238
239
-
The build signature is used to distinguish different builds of the same project. It is mainly calculated based on the **build configuration** of a project. But it also incorporates information that depends on the UI5 CLI version (specifically an internal `BUILD_CACHE_VERSION` integer), as well as potentially provided signatures of custom tasks.
239
+
The build signature is used to distinguish different builds of the same project. It is mainly calculated based on the **build configuration** of a project. But it also incorporates information that depends on the UI5 CLI version (specifically an internal `BUILD_SIG_VERSION` integer constant), as well as optional signatures provided by custom tasks.
240
240
241
-
It's purpose is to easily tell whether an existing cache should be used for a given build execution or not. For example, a "jsdoc"-build should use a different cache than a regular project build.
241
+
This signature is used to easily tell whether an existing cache can be used in a given build execution or not. For example, a "jsdoc"-build leads to a different build signature than a regular project build. Therefore, two independent cache entries will be created on disk.
242
242
243
243
The signature is a simple hash (represented as a hexadecimal string, to allow usage in directory and file names).
244
244
245
-
A mechanism shall be created for custom tasks to provide a signature as well. This allows the incorporation of task-specific configuration files (e.g. tsconfig.json for a TypeScript compilation task) into the build signature
246
-
245
+
A mechanism shall be created for custom tasks to provide a signature as well. This allows the incorporation of task-specific configuration files (e.g. tsconfig.json for a TypeScript compilation task) into the build signature.
247
246
248
247
### Index Cache
249
248
@@ -355,7 +354,7 @@ These signatures can be used to quickly check whether a cache exists by looking
355
354
356
355
Stores the metadata of all resources for a given "stage". This metadata can be used to access the resource content from the content-addressable store.
357
356
358
-
Stage cache metadata is keyed using the project's build signature, the stage name, and the index signature of the input resources for that stage.
357
+
Stage cache metadata is keyed using the project's [build signature](#build-signature), the stage name, and the index signature of the input resources for that stage.
359
358
360
359
Each stage usually corresponds to the execution of a task. The contained metadata represents all resources **written** by that task during its execution. The metadata includes the `lastModified`, `size` and `integrity` of each resource. This information is required for determining whether subsequent tasks need to be re-executed.
361
360
@@ -393,7 +392,7 @@ A new `buildCache` directory shall be added to the ~/.ui5/ directory. The locati
393
392
394
393
The `cas` directory contains files named by their content hash. Each file contains the raw content of a resource produced during a build. Ideally a library like [`cacache`](#cacache) should be used to manage the content-addressable store. In this case, the actual directory structure might differ from what is depicted above.
395
394
396
-
The `buildManifests` directory contains one build manifest file per project build cache. The directory structure is derived from the project's package name (Project ID). The files are named by the [build signature](#signature).
395
+
The `buildManifests` directory contains one build manifest file per project build cache. The directory structure is derived from the project's package name (Project ID). The files are named by the [build signature](#build-signature).
397
396
398
397
Instead of storing the index cache, stage caches and build task caches as separate files on disk, they shall also be stored in a database such as LevelDB or SQLite. This allows for faster access and reduces the number of files on disk.
399
398
@@ -411,15 +410,15 @@ In this concept, cacache will be used to store the content of resources produced
The [build signature](#signature) binds the entry to the current project build cache. The stage name and resource path correspond to a task's **output** resource metadata as defined in the [`stages`](#stages) section of the `build-manifest.json`.
413
+
The [build signature](#build-signature) binds the entry to the current project build cache. The stage name and resource path correspond to a task's **output** resource metadata as defined in the [`stages`](#stages) section of the `build-manifest.json`.
415
414
416
415
This naming schema should allow for easy retrieval of resources based on the metadata stored in the build manifest.
417
416
418
417
At the same time, this also enables the cacache-internal garbage collection to identify unused entries. If a task execution produces new content for a resource, the cacache entry will be updated to point to the new content hash. Eventually, the old content hash will no longer be referenced by any cache entry and can be cleaned up during [garbage collection](#garbage-collection).
419
418
420
419
### Cache Import
421
420
422
-
Before building a project, UI5 CLI shall check for an existing cache by calculating the [build signature](#signature) for the current build, and searching the [cache directory structure](#cache-directory-structure) for a matching build manifest.
421
+
Before building a project, UI5 CLI shall check for an existing cache by calculating the [build signature](#build-signature) for the current build, and searching the [cache directory structure](#cache-directory-structure) for a matching build manifest.
423
422
424
423
If a build manifest is found it is imported by the `Project Build Cache`
425
424
1. Check the source files of the project against the `index` section of the build manifest to determine which files have changed since the last build
@@ -469,7 +468,7 @@ The watch mode shall be used by the server to automatically rebuild projects whe
469
468
470
469
#### Cache Invalidation
471
470
472
-
**It is to be decided** whether, besides watching relevant source files, the watch mode shall also watch configuration files relevant for the build signature (e.g. ui5.yaml, package.json, tsconfig.json, etc.). If any of those files change, the cache needs to be replaced using the build signature.
471
+
**It is to be decided** whether, besides watching relevant source files, the watch mode shall also watch configuration files relevant for the build signature (e.g. ui5.yaml, package.json, tsconfig.json, etc.). If any of those files change, a different cache would have to be used. This might be unexpected behavior to some users, where launching a development tool only reads the relevant configuration once and then keeps using it even when the underlying files change.
0 commit comments