build icon indicating copy to clipboard operation
build copied to clipboard

[Tooling] `build_runner watch` shouldn't break when the builder code changes to an invalid code

Open davidmorgan opened this issue 11 months ago • 0 comments

Discussed in https://github.com/dart-lang/build/discussions/3839

Originally posted by mateusfccp February 10, 2025 If you run build_runner watch in a project that is consuming a stable build package, like json_serializable or freezed, if you change your code to something invalid, the process won't break. Instead, it will print the errors it found and will wait for the next code version to try to generate it again.

(Sometimes it breaks, but I consider it a bug and it should be addressed elsewhere. The normal expected behavior is for it to not break)

This is not true if you are changing the builder itself. Whenever you are building [sic] a builder, if you change your builder to invalid code (like code with static errors), the tool will print in the stdout that the code has errors and crash.

This hinders the development process, as one has to keep rerunning build_runner (either build or watch) whenever they make any change.

Making build_runner fault tolerant to changes in the builder itself would streamline the development process.

davidmorgan avatar Feb 10 '25 09:02 davidmorgan