-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[ Tool ] Use a separate output directory when the native hooks run the build system #178840
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 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
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 correctly addresses an issue with incorrect file deletion during builds by using a separate output directory for native hooks. This is achieved by creating a new Environment for the hook runner with a dedicated output path. The changes are logical, and a new test has been added to verify the fix. I have one suggestion regarding the maintainability of how the new Environment object is created.
packages/flutter_tools/lib/src/build_system/targets/hook_runner_native.dart
Outdated
Show resolved
Hide resolved
…oks run the build system (flutter/flutter#178840)
flutter/flutter@9f383e0...d438df3 2025-11-21 [email protected] [ Tool ] Use a separate output directory when the native hooks run the build system (flutter/flutter#178840) 2025-11-21 [email protected] Fix Windows Enter key after focus loss (flutter/flutter#178523) 2025-11-21 [email protected] Roll Dart SDK from 369795548c09 to c788b6a7aefd (1 revision) (flutter/flutter#178924) 2025-11-21 [email protected] Roll Skia from 51fd48dccfb8 to d4e9d2873bfd (4 revisions) (flutter/flutter#178912) 2025-11-21 [email protected] Add changelog for 3.38.2 (flutter/flutter#178796) 2025-11-21 [email protected] Roll Dart SDK from 003a42bad376 to 369795548c09 (2 revisions) (flutter/flutter#178899) 2025-11-21 [email protected] Roll Skia from b9eafe0fab0c to 51fd48dccfb8 (1 revision) (flutter/flutter#178897) 2025-11-21 [email protected] Roll Dart SDK from 0894b46fff76 to 003a42bad376 (1 revision) (flutter/flutter#178889) 2025-11-21 [email protected] Make sure that a TextSelectionToolbarTextButton doesn't crash in 0x0 … (flutter/flutter#178374) 2025-11-21 [email protected] Make sure that a CupertinoSpellCheckSuggestionsToolbar doesn't crash … (flutter/flutter#177978) 2025-11-21 [email protected] Make sure that a TabBar doesn't crash in 0x0 environment (flutter/flutter#178201) 2025-11-20 [email protected] Make sure that a ToggleButtons doesn't crash in 0x0 environment (flutter/flutter#178454) 2025-11-20 [email protected] Roll Skia from d7b961c5f305 to b9eafe0fab0c (6 revisions) (flutter/flutter#178888) 2025-11-20 [email protected] Add macrobenchmark perf test for drawing arcs (flutter/flutter#178690) 2025-11-20 [email protected] Roll Dart SDK from 5b21f8a7d5d3 to 0894b46fff76 (1 revision) (flutter/flutter#178881) 2025-11-20 [email protected] Roll Skia from 6284b4f09e14 to d7b961c5f305 (1 revision) (flutter/flutter#178867) 2025-11-20 [email protected] Roll Fuchsia Linux SDK from 0z3qxzY6CWb8iVxEf... to Y-cMdgKy3d6EnibWR... (flutter/flutter#178865) 2025-11-20 [email protected] Roll Packages from 8f72e4b to b1e2fb0 (6 revisions) (flutter/flutter#178868) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…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
…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
…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
…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
…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
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 #178529