-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CP-stable][ Tool ] Use a separate output directory when the native hooks run the build system #179016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e build system (flutter#178840) FlutterBuildSystem.trackSharedBuildDirectory stores a hash of the most recently run build configuration in the output directory defined in the environment. If the build executed by FlutterHookRunnerNative uses the same output directory as other builds, then trackSharedBuildDirectory may think that the hook build's output list replaces the outputs of those previous builds. trackSharedBuildDirectory will then incorrectly delete files in the previous output list because they are not part of the hook build's outputs. See flutter#178529
|
@bkonyi please fill out the PR description above, afterwards the release team will review this request. |
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
There was a problem hiding this comment.
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 introduces a separate output directory for the native hooks build system to avoid conflicts with the main build. This is achieved by adding a copyWith method to the Environment class and using it in FlutterHookRunnerNative to create a new environment with a dedicated output subdirectory. A new test is added to verify this behavior. The changes are logical and well-tested. My feedback focuses on adding documentation to the new public members to align with the repository's style guide.
packages/flutter_tools/lib/src/build_system/targets/hook_runner_native.dart
Show resolved
Hide resolved
cf258ba
into
flutter:flutter-3.38-candidate.0
…e native hooks run the build system (flutter/flutter#179016)
…e native hooks run the build system (flutter/flutter#179016)
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#178529
Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.
Running
flutter run -d chromeon a project with localization generation, the generated localizations classes are deleted immediately.Changelog Description:
Explain this cherry pick:
See best practices for examples.
When running
flutter run -d chromeon projects with localizations, generated localizations sources are deleted on first run.Workaround:
Is there a workaround for this issue?
flutter run -d chrome, which will fail due to the generated localizations code being deletedflutter run -d chromeagain, which will only rebuild the generated localizations code without rerunning the native hooks build step.Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
Run
flutter run -d chromein a project with localizations, ensure it actually starts.