Skip to content

[CP] Fix dart run missing fast path when using Flutter #55758

@sigurdm

Description

@sigurdm

Commit(s) to merge

dart-lang/pub@e70850b
Rolled to the sdk in: https://dart-review.googlesource.com/c/sdk/+/367024?tab=checks

Target

stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/367060

Issue Description

Without this it is hard/impossible to use build_runner together with localization on flutter.

dart run build_runner build would wrongly think that the current resolution is stale, and redo it. Missing the flutter_gen package that flutter pub get injects to the package config.

This is a regression that was introduced in: dart-lang/pub#4160 rolled to the sdk in 74c94ee

See dart-lang/build#3705

What is the fix

By fixing the fast-path check, we will not replace the package_config if it is up-to-date.

This does not fix the underlying problem that dart run doesn't inject the flutter_gen package when the resolution is stale, but at least makes it possible to run build_runner when localization is enabled.

Why cherry-pick

To fix the regression

Risk

Medium-low

Issue link(s)

See dart-lang/build#3705

Extra Info

No response

Metadata

Metadata

Labels

area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-reviewIssue that need cherry pick triage to approvedart-cli-runIssues related to 'dart run'

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions