Skip to content

Pass manifestPath to assetBundle in ResidentWebRunner and throw ToolExit in computeTransitiveDependencies - #194474

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
bkonyi:issue-194444
Nov 4, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
bkonyi:issue-194444

Conversation

@bkonyi

@bkonyi bkonyi commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Passes manifestPath: flutterProject.pubspecFile.path to assetBundle.needsBuild and assetBundle.build in ResidentWebRunner._updateDevFS so that commands targeting a nested project (such as flutter widget-preview start) do not fall back to reading the root working directory's pubspec.yaml and package_graph.json. Also updates computeTransitiveDependencies to throw a ToolExit instead of a null-check error if a package in package_graph.json is missing from package_config.json.

Fixes #194444

@bkonyi bkonyi added the CICD Run CI/CD label Oct 15, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates ResidentWebRunner to pass the explicit manifestPath from the flutterProject to assetBundle.needsBuild and assetBundle.build. It also modifies package_graph.dart to throw a ToolExit with a descriptive error message when a package dependency is missing from package_config.json. Corresponding tests have been added to verify both behaviors. There are no review comments, and I have no feedback to provide.

@bkonyi
bkonyi requested review from DanTup and chingjun October 15, 2026 20:06
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 15, 2026
chingjun
chingjun previously approved these changes Oct 15, 2026
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 15, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 16, 2026
@auto-submit

auto-submit Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/194474, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

DanTup
DanTup previously approved these changes Oct 16, 2026

@DanTup DanTup left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkonyi thanks! Do you know why this was only happening sometimes?

@DanTup

DanTup commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@bkonyi do you know if the failure here was a flake, or a legitimate issue?
(I just hit this issue again today and recalled seeing a fix for it, but looks like it didn't land)

@bkonyi
bkonyi dismissed stale reviews from DanTup and chingjun via 57f0e73 October 30, 2026 18:16
@bkonyi
bkonyi requested a review from chingjun October 30, 2026 18:22
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Nov 4, 2026
@bkonyi

bkonyi commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@DanTup sorry for the delay!

Do you know why this was only happening sometimes?

This actually wasn't intermittent for widget-preview. It started failing deterministically after #189437 removed fs.currentDirectory = widgetPreviewScaffold; from WidgetPreviewStartCommand. ResidentWebRunner._updateDevFS was calling assetBundle.build() without a manifestPath, so it defaulted to the pubspec.yaml and .dart_tool/package_graph.json in the CWD (the root project) while passing .widget_preview/.dart_tool/package_config.json. Because PreviewPubspecBuilder strips flutter_test when regenerating the scaffold pubspec, the root project's package_graph.json included flutter_test (from dev_dependencies) while the scaffold's package_config.json didn't, causing packageConfig[current]! to fail on every launch. (#185272 hit the same assertion via flutter pub add, which is why the stack frame looked familiar.)

do you know if the failure here was a flake, or a legitimate issue?

Yep, it was a flake!

@DanTup

DanTup commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@bkonyi thanks! Seems like you might be right, all of the builds on https://github.com/Dart-Code/E2E-Tests/actions are red since 13th Oct when that landed.. for some reason I thought it was passing sometimes.

I'll force a build after this lands to check it goes back green. Thanks! 🙂

Merged via the queue into flutter:master with commit c3a0347 Nov 4, 2026
34 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2026
@DanTup

DanTup commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@bkonyi green! Thanks! 🙂

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tool_crash] Null check operator used on a null value - computeTransitiveDependencies (package:flutter_tools/src/package_graph.dart:76:29)

3 participants