Skip to content

build runner and build daemon do not emit warnings from the build #3184

@annagrin

Description

@annagrin

I tried to write a test for properly handling the --enable-experiment option in build daemon and discovered that warnings are not emitted from the compiler. Same for build runner.

See: #3183
In particular, discussion in the comments: https://github.com/dart-lang/build/pull/3183/files/286019b0881bf346af7d2278d46a1e7a69e3f99d#diff-52928f64ac1f76149efee2f7237ff7a360edd69263873a733902b7f701a8abac

As a note, the argument is passed to the build - compiling code that uses constructor tearoffs and using build runner with --enable-experiment=constructor-tearoffs succeeds, while using build runner with --enable-experiment=constructor-tearoff fails to compile, as expected.

Repro: try to build a simple app with one file using a non-existing flag: --enable-experiments=constructor-tearoff.

Dartdevc emits the warning:

➜  dartdevc --enable-experiment=constructor-tearoff web/main.dart -o output.js
Unknown experiment: constructor-tearoff

build_runner does not emit the warning:

➜  dart run build_runner build --enable-experiment=constructor-tearoff --verbose
[INFO] Entrypoint:Generating build script...
[INFO] Entrypoint:Generating build script completed, took 405ms

[INFO] Bootstrap:Precompiling build script......
[INFO] Bootstrap:Precompiling build script... completed, took 6.5s

[FINE] Bootstrap:Core package locations file does not exist
[INFO] BuildDefinition:Initializing inputs
[INFO] BuildDefinition:Building new asset graph...
[INFO] BuildDefinition:Building new asset graph completed, took 911ms

[INFO] BuildDefinition:Checking for unexpected pre-existing outputs....
[INFO] BuildDefinition:Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Build:Running build...
[INFO] build_resolvers:Generating SDK summary...
[INFO] Heartbeat:3.2s elapsed, 0/1 actions completed.
[INFO] build_resolvers:Generating SDK summary completed, took 3.1s

[INFO] Heartbeat:4.3s elapsed, 0/2 actions completed.
[INFO] Heartbeat:5.3s elapsed, 0/2 actions completed.
[INFO] Build:Running build completed, took 6.3s

[INFO] Build:Caching finalized dependency graph...
[INFO] Build:Caching finalized dependency graph completed, took 181ms

[INFO] Build:Succeeded after 6.4s with 14 outputs (1315 actions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-infoAdditional information needed from the issue author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions