-
Notifications
You must be signed in to change notification settings - Fork 205
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
pub run build_runner build
returns exit code 0 even when SEVERE errors reported
#910
Comments
There is a flag to fail builds, I can't recall exactly what it is but --help should show it. This is a bit of a grey area because at dev time it isn't clear we want to fail the build, there is value in letting you see what it was able to complete |
I'm not sure I agree that we don't want to fail the build at dev time. Internally, we fail the build if any of the builders report an error. The normal dev cycle would be to use I've noticed issues like this on travis, where the build "fails", but returns exit code 0, and thus travis thinks everything is dandy. |
Yes, that is the one of the main issues. |
There is a The reason this is not the default is similar to
... which would match the internal build system, but be frustrating to some users. @alorenzen @chalin If that flag works for you, let's file a separate issue about defaulting it. |
The option
|
That doesn't look good, the test cases look fine: build/build_runner/test/generate/build_error_test.dart Lines 34 to 65 in 2da9f97
/cc @natebosch @jakemac53 |
My guess here would be that there was a previous build ran without --fail-on-severe (where the actual failures happened), and then there was an incremental build with --fail-on-severe which didn't actually re-run the failing parts, so we never saw a severe log. In general, if the build fails I believe that we wouldn't cache the asset graph so we would always rerun the build, but if you don't provide that flag when it initially fails then we get in this situation. |
I actually started afresh: > rm -Rf build .dart* *.lock And then ran |
ah yep I can repro even on e2e_example |
Looks like we parse it but we never pass the option to
|
That would do it :) |
With #922 fresh builds will have the correct behavior. There are a few remaining issues so I will keep this open:
|
@jakemac53 Can you give an example of |
Example use case for
|
Cool, makes sense! |
Also just hit this – by default I'd argue that rebuilding something with errors should show all of the errors the next time around. |
Showing the errors is one aspect - rerunning is a different aspect. One thing I hope to avoid doing is rerunning by default because it encourages us to tolerate things that fail to build for flaky reasons. We could consider storing details when things fail though if our main focus is not losing them when the previous build scrolls away. |
Towards #910 The main benefit of the proposed `--rerun-failing-actions` is to be able to see errors again from previous builds that have scrolled off screen. The downside to rerunning is that it is a pattern encouraging retrying non-hermetic actions. Instead we will store and re-print previous error messages which more directly addresses the need. This commit sketches out the interaction between the failure reporter and the build - storage of errors to individual files will happen in a followup.
Closes #910 The main benefit of the proposed `--rerun-failing-actions` is to be able to see errors again from previous builds that have scrolled off screen. The downside to rerunning is that it is a pattern encouraging retrying non-hermetic actions. Instead we will store and re-print previous error messages which more directly addresses the need.
If I seed a template error and run test over one of the toh-0 example app like this:
pub run build_runner build --delete-conflicting-outputs --output=build; echo $?
I get:
[INFO] Entrypoint: Generating build script completed, took 334ms
[INFO] BuildDefinition: Building new asset graph completed, took 663ms
[INFO] BuildDefinition: Checking for unexpected pre-existing outputs. completed, took 1ms
[SEVERE] Instance of 'LibraryBuilder' on angular_tour_of_heroes|lib/app_component.dart: Error running TemplateGenerator for angular_tour_of_heroes|lib/app_component.dart.
Template parse errors:
... [some error]...
Please fix all errors before compiling (warnings are okay).
}
[WARNING] Instance of 'WebEntrypointBuilder' on angular_tour_of_heroes|test/app_test.dart: Unable to read angular_tour_of_heroes|test/app_test.ddc.js, check your console for compilation errors.
[WARNING] Instance of 'WebEntrypointBuilder' on angular_tour_of_heroes|test/app_test.dart.browser_test.dart: Unable to read angular_tour_of_heroes|test/app_test.ddc.js, check your console for compilation errors.
[INFO] Build: Running build completed, took 20.0s
[INFO] Build: Caching finalized dependency graph completed, took 100ms
[INFO] CreateOutputDir: Creating merged output dir
build
completed, took 1.4s[INFO] Build: Succeeded after 21.6s with 2074 outputs
0
So, in summary:
I'm using the latest build_* packages:
cc @kwalrath
The text was updated successfully, but these errors were encountered: