Skip to content

[native_assets_builder] Concurrency between Dart runs and asset edits #1534

@dcharkes

Description

@dcharkes

For v1.0, we'll say that this is not a supported use case.

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    package:hooks_runnertype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions