• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / native / 12066962280
92%

Build:
DEFAULT BRANCH: main
Ran 28 Nov 2024 10:23AM UTC
Jobs 14
Files 229
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Nov 2024 10:22AM UTC coverage: 88.85% (+0.003%) from 88.847%
12066962280

push

github

web-flow
[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

New Missed Lines in Diff

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

Uncovered Existing Lines

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
Subprojects
ID Flag name Job ID Ran Files Coverage
6 native_toolchain_c_macos 12066962280.6 28 Nov 2024 10:24AM UTC 25
69.66
GitHub Action Run
7 native_assets_builder_ubuntu 12066962280.7 28 Nov 2024 10:27AM UTC 11
90.17
GitHub Action Run
8 native_assets_cli_windows 12066962280.8 28 Nov 2024 10:25AM UTC 30
76.95
GitHub Action Run
9 native_toolchain_c_windows 12066962280.9 28 Nov 2024 10:26AM UTC 25
78.74
GitHub Action Run
10 native_assets_builder_macos 12066962280.10 28 Nov 2024 10:27AM UTC 11
90.17
GitHub Action Run
11 native_toolchain_c_ubuntu 12066962280.11 28 Nov 2024 10:24AM UTC 25
74.24
GitHub Action Run
12 native_assets_cli_macos 12066962280.12 28 Nov 2024 10:23AM UTC 30
77.29
GitHub Action Run
13 native_assets_cli_ubuntu 12066962280.13 28 Nov 2024 10:24AM UTC 30
77.29
GitHub Action Run
14 native_assets_builder_windows 12066962280.14 28 Nov 2024 10:29AM UTC 11
90.17
GitHub Action Run
14 objective_c 12059440972.14 27 Nov 2024 10:59PM UTC 73
78.37
GitHub Action Run
14 swift2objc 12059107618.14 27 Nov 2024 10:24PM UTC 39
88.12
GitHub Action Run
2 ffigen 11849122173.2 15 Nov 2024 02:35AM UTC 72
91.46
GitHub Action Run
14 jni 12066247136.14 28 Nov 2024 09:40AM UTC 30
75.5
GitHub Action Run
13 jnigen 12066247136.13 28 Nov 2024 09:47AM UTC 21
91.04
GitHub Action Run
Source Files on build 12066962280
  • Tree
  • List 229
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12066962280
  • 081b195d on github
  • Prev Build on main (#12066247136)
  • Next Build on main (#12067979516)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc