Skip to content

Update background task patterns for build_runner 2.5.0 - #5572

Merged
DanTup merged 1 commit into
Dart-Code:masterfrom
mernen:build-runner-problem-matchers
Jul 3, 2025
Merged

DanTup merged 1 commit into
Dart-Code:masterfrom
mernen:build-runner-problem-matchers

Conversation

@mernen

@mernen mernen commented Jul 2, 2025 •

Copy link
Copy Markdown
Contributor

build_runner v2.5.0 changed the output format. The relevant new messages are:

Starting new build:
https://github.com/dart-lang/build/blob/8f9939f3c804edb91d4df33045536f6894472af0/build_runner_core/lib/src/logging/build_log.dart#L388-L390

Success/failure:
https://github.com/dart-lang/build/blob/8f9939f3c804edb91d4df33045536f6894472af0/build_runner_core/lib/src/logging/build_log.dart#L58-L62C41

The old background patterns are kept, since projects may keep using older versions of build_runner for a long while. I don't expect them to interfere with each other.

(As far as I can tell, there are no tests for problem matchers?)

Also: I didn't change the problem matchers, only the background ones. I don't think it's possible to build a single matcher that works with both old and new outputs, and even if we were to have two separate problemMatchers, I'm not sure if the output can be properly described, since error messages are often multiline.

AFAIK the only consequence of outdated problem matchers is that we don't offer build errors in the Problems pane, whereas having outdated background matchers means preLaunchTasks never finish and launch operations get stuck.

@mernen
mernen force-pushed the build-runner-problem-matchers branch from 02ae54c to abc728f Compare July 2, 2025 17:00
@mernen mernen changed the title Update task patterns for build_runner 2.5.0 Update background task patterns for build_runner 2.5.0 Jul 2, 2025
@mernen
mernen force-pushed the build-runner-problem-matchers branch from abc728f to eaa3bb0 Compare July 2, 2025 17:20
@DanTup

DanTup commented Jul 2, 2025

Copy link
Copy Markdown
Member

(As far as I can tell, there are no tests for problem matchers?)

Unfortunately so. A lot of VS Code can't be automated through the basic APIs, so it'd need something like Playwright for real e2e tests (something that would be nice to set up for a few things, but hasn't so far been enough to justify the work).

Have you verified this manually that it's detecting the stop/start as expected?

Also: I didn't change the problem matchers, only the background ones. I don't think it's possible to build a single matcher that works with both old and new outputs, and even if we were to have two separate problemMatchers, I'm not sure if the output can be properly described, since error messages are often multiline.

Depending on when the format changes, it probably wouldn't be a bad idea to support the new version without the old version if both can't be supported, though I'm not sure it's that important - it's possible in future we'll revisit this integration anyway because there's been more work going into build_runner now Macros is gone (see dart-lang/build#3806).

@mernen

mernen commented Jul 3, 2025

Copy link
Copy Markdown
Contributor Author

Have you verified this manually that it's detecting the stop/start as expected?

Yes. (I haven't tried running the modified extension directly, but I did place this matcher in a project's .vscode/tasks.json.) The "building" warning appears correctly during rebuilds, and disappears once the build finishes with either success or failure.

@DanTup DanTup added this to the v3.116.0 milestone Jul 3, 2025
@DanTup DanTup added the in tasks Relates to VS Code tasks, such as those provided by Task Providers label Jul 3, 2025
@DanTup
DanTup merged commit 5af4bb0 into Dart-Code:master Jul 3, 2025
@DanTup

DanTup commented Jul 3, 2025

Copy link
Copy Markdown
Member

Perfect, thank you!

@DanTup DanTup added the is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix. label Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in tasks Relates to VS Code tasks, such as those provided by Task Providers is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants