Skip to content
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] Concurrency between Dart runs and asset edits #1534

Open
dcharkes opened this issue Sep 9, 2024 · 0 comments
Open
Labels
package:native_assets_builder type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@dcharkes
Copy link
Collaborator

dcharkes commented Sep 9, 2024

If we have a long running Dart program that's running in the background and using assets, and at the same time we try to modify asset files (either by hand, or by rerunning a hook), we run into file locking issues on Windows.

  • Modifying a asset/my_data.txt while a Dart program has it already open.
  • Modifying a C program while the Dart program is already running, and then running the same program in another terminal concurrently, triggering the hook again.

We either need to:

  1. Ensure we copy files out, so that after the native_assets_builder is done running, Dart/Flutter only use copies of the files produced by hooks. Originally posted by @dcharkes in [native_assets_builder] Set the last modified date of assets to the build output timestamp #1533 (comment)
  2. Or, we should provide some reasonable error messages. But how do we do that? Locking the asset build directories and asset files while running?

Thanks @blaugold for bringing this up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:native_assets_builder type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

1 participant