Skip to content

[dartdev][flutter_tools] Rerunning commands needs to be a NOP for assets if hooks were cached #1552

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

Open
1 task
dcharkes opened this issue Sep 11, 2024 · 1 comment

Comments

@dcharkes
Copy link
Collaborator

dcharkes commented Sep 11, 2024

After the hooks are run in dartdev/flutter_tools, the assets might be copied/signed/install_name modified etc.

We'd like to ensure that we can cache those steps.

We cannot blindly rely on timestamps, as a hook might return a file with an older timestamp (on Windows downloaded files have their creation date as lastmodified, not the downloaded time). We could fix this by mandating that assets should have monotonically increasing timestamps, but that puts burden on the hook writer.

Maybe there are better solutions (using a hash, ...).

Also flutter run and flutter build --release copy files both to build/native_assets/* which also breaks the NOP-ness.

To investigate

Context:

This needs to play well with concurrent invocations as well:

Edit:

Thanks @mkustermann and @blaugold

@dcharkes dcharkes added this to the Native Assets v1.0 milestone Sep 11, 2024
@dcharkes
Copy link
Collaborator Author

dcharkes commented Dec 9, 2024

This is working for flutter_tools, which consumes the BuildOutput.dependencies and does it's own file-content-hashing based tracking of whether those files change.

For Dartdev we have a tracking issue:

Since this is an implementation details that should work, I'm bumping this to after v1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant