source_gen icon indicating copy to clipboard operation
source_gen copied to clipboard

Drop InvalidGenerationSourceError

Open natebosch opened this issue 4 years ago • 3 comments

This class does not follow best practices, and I think it's outlived it's usefulness. We'd also like to shift the concept of a build failure into the core build system instead of source_gen. The concept of writing "error" output to the generated file is also outdated. I don't think any of our build systems treat the file as having any useful content if it is a failure.

https://github.com/dart-lang/build/issues/981

cc @davidmorgan - this class is used in built_value_generator. I think most of that error handling can be remove entirely. It should be fine to let the exception bubble up.

cc @jakemac53 @leonsenft

natebosch avatar Mar 09 '20 22:03 natebosch

Thanks, filed an issue for built_value. Any timeline for this? I guess built_value will need updating before we can roll the updated source_gen to google3.

davidmorgan avatar Mar 10 '20 15:03 davidmorgan

We'll hopefully have a migration plan or at least a design for a replacement before dropping it here so no rush for now.

natebosch avatar Mar 10 '20 15:03 natebosch

FYI a3e3c9af7c8937b096d1c618e0ed50f71be9de63 does away w/ the idea of including error messages in source code

kevmoo avatar Jul 10 '20 21:07 kevmoo

I think we turned out to expand usage of InvalidGenerationSource, and it does seem to be useful enough to keep.

natebosch avatar Dec 15 '23 20:12 natebosch