-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native_assets_builder] Set the last modified date of assets to the build output timestamp #1533
Conversation
… build output timestamp
native_assets_builder
] Set the last modified date of assets to the build output timestamp
PR HealthBreaking changes ✔️
Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
Package publish validation ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
We need to think a bit more about this. Changing the date only works if the output file is in the output directory. If we have If building assets can be shared for some configurations (let's say debug/release doesn't make a difference), then we'd want to encourage caching such asset in And for in-hook caching, I'd like to give hook writers the contract that the hook runner does not modify any files. Also, if the hook runs because 1 asset changed, but 10 assets didn't we'll touch the other 10 assets and have to recopy them. Some options:
Maybe the deeper question is what concurrency we want to support:
This last use case is currently broken. I think we can only support the last use case if we already copy in We can still try to avoid extra copies/resigns hashing the file contents, but I'm not sure if that's faster or slower. Sorry to send you in to the weeds @blaugold. I'm discovering requirements as we go! 🤓 Any other concurrency cases you can think of, now that we're at it? |
No problem, that's how it goes. 🙂 And thanks for taking the time to write down your thoughts! I can't think of other concurrency scenarios, ATM. |
With #1750, the native assets builder will use file content hashing. So, we'll no longer have to worry about timestamps. |
With this PR, all assets that are produced by a hook have their last modified date set to the
HookOutput.timestamp
.This ensures that caching mechanisms can use the last modified time of assets to invalidate cached results that depend on assets. See https://dart-review.googlesource.com/c/sdk/+/381580 for context.
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.