Ran
|
Jobs
14
|
Files
229
|
Run time
1min
|
Badge
Embed ▾
README BADGES
|
push
github
[native_assets_builder] Use file content hashing (#1750) This PR changes the caching behavior for hooks to be file content hashing instead of last modified timestamps. Closes: https://github.com/dart-lang/native/issues/1593. In addition to using file hashes, a timestamp is passed in to detect if files were modified during a build. The moment of hashing contents is after a build is finished, but we should consider files changed after the build started to invalidate the build. If this happens, the build succeeds, but the cache is invalidated and a warning is printed to the logger. The implementation was modeled after the [`FileStore` in flutter_tools](https://github.com/flutter/flutter/blob/1e824af6b/packages/flutter_tools/lib/src/build_system/file_store.dart). However, it was adapted to support caching directories and to match the code style in this repository. Directory caching is defined as follows: the hash of the names of the children. This excludes recursive descendants, and excludes the contents of children. For recursive caching (and glob patterns), the populator of the cache should do the glob/recursion to add all directories and files. ### Testing * The existing caching tests (such as `pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart`) cover caching behavior. * Now that last-modified are no longer used, some sleeps have been removed from tests. ð ### Performance Adding a stopwatch to pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart for the second invocation of the hooks so that it is cached. * `lastModified` timestamps: 0.028 seconds (pre this PR) * `package:crypto` `md5`: 0.047 seconds (current PR) * `package:xxh3` `xxh3`: 0.042 seconds The implementation does not use parallel system IO for loading files (no `Future.wait`), but does use async I/O to allow flutter_tools to run other `Target`s in parallel. The (pre and ... (continued)
99 of 103 new or added lines in 2 files covered. (96.12%)
12 existing lines in 2 files now uncovered.11483 of 12924 relevant lines covered (88.85%)
35.44 hits per line
Lines | Coverage | ∆ | File |
---|---|---|---|
1 |
98.59 |
pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart | |
3 |
91.33 |
-3.24% | pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart |
Lines | Coverage | ∆ | File |
---|---|---|---|
5 |
63.16 |
10.53% | pkgs/native_assets_builder/lib/src/utils/file.dart |
7 |
91.33 |
-3.24% | pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart |
ID | Flag name | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|---|
6 | native_toolchain_c_macos | 12066962280.6 | 25 |
69.66 |
GitHub Action Run | |
7 | native_assets_builder_ubuntu | 12066962280.7 | 11 |
90.17 |
GitHub Action Run | |
8 | native_assets_cli_windows | 12066962280.8 | 30 |
76.95 |
GitHub Action Run | |
9 | native_toolchain_c_windows | 12066962280.9 | 25 |
78.74 |
GitHub Action Run | |
10 | native_assets_builder_macos | 12066962280.10 | 11 |
90.17 |
GitHub Action Run | |
11 | native_toolchain_c_ubuntu | 12066962280.11 | 25 |
74.24 |
GitHub Action Run | |
12 | native_assets_cli_macos | 12066962280.12 | 30 |
77.29 |
GitHub Action Run | |
13 | native_assets_cli_ubuntu | 12066962280.13 | 30 |
77.29 |
GitHub Action Run | |
14 | native_assets_builder_windows | 12066962280.14 | 11 |
90.17 |
GitHub Action Run | |
14 | objective_c | 12059440972.14 | 73 |
78.37 |
GitHub Action Run | |
14 | swift2objc | 12059107618.14 | 39 |
88.12 |
GitHub Action Run | |
2 | ffigen | 11849122173.2 | 72 |
91.46 |
GitHub Action Run | |
14 | jni | 12066247136.14 | 30 |
75.5 |
GitHub Action Run | |
13 | jnigen | 12066247136.13 | 21 |
91.04 |
GitHub Action Run |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|