{{ message }}
Fix package root resolution after build_runner 2.14.0 AOT changes#750
Open
Carapacik wants to merge 2 commits intoFlutterGen:mainfrom
Open
Fix package root resolution after build_runner 2.14.0 AOT changes#750Carapacik wants to merge 2 commits intoFlutterGen:mainfrom
Carapacik wants to merge 2 commits intoFlutterGen:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this change?
This fixes package root resolution in
flutter_gen_runnerafter thebuild_runner 2.14.0change that runsbuild/watchthrough AOT by default.Previously,
FlutterGenBuilderrelied onIsolate.packageConfigSync!as the only source for package roots. With the newer AOT build-script flow, the runtime isolate package config can be null or no longer represent the active build graph, which may crash the builder or fail to resolve the target package root, especially on Windows.The package root is now resolved in this order:
BuildStep.packageConfigas the primary source for the active build graph..dart_tool/package_config.jsonor a matchingpubspec.yamlunder the current working directory.This also removes the eager static runtime package config load, avoiding the null assertion crash from
Isolate.packageConfigSync!.Fixes #749 🎯
Type of change
Checklist:
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
melos run test)melos run formatto automatically apply formatting)