Skip to content

Conversation

@flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Oct 21, 2025

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:

None

Changelog Description:

Calling FileSystemEntity.watch(...) will throw on Mac OS and Windows.

Impact Description:

Calling FileSystemEntity.watch(...) will throw on Mac OS and Windows, instead of correctly watching the path.

Workaround:

No user level work-around. dart:io is broken.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

It's tested by tests in Dart SDK

Validation Steps:

Run a Mac OS or Windows app with the following main. It should do nothing - rather than throw an exception.

import 'dart:async';
import 'dart:io';

void main() async {
  final sub = Directory.systemTemp.watch(recursive: true).listen((_) {});
  await Future.delayed(Duration(seconds: 1));
  sub.cancel();
}

This is needed by file watching implementation after
dart-lang/sdk@ed6bab8

Ideally we should actually move this whole code into `io_natives.{h,cc}`
on the Dart runtime side to avoid duplication.
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Oct 21, 2025
@flutteractionsbot
Copy link
Author

@mraleph please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard
Copy link

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.

@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Oct 21, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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, a cherry-pick, configures the FfiNative resolver for dart:io. The change involves adding a call to Dart_SetFfiNativeResolver for the dart:io library during isolate initialization. This is consistent with how native resolvers are set up for other core libraries. The code change is straightforward and I have no further feedback.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 configures the FFI native resolver for dart:io during isolate initialization by adding a call to Dart_SetFfiNativeResolver. My review focuses on the error handling pattern used for this new call.

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 27, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Oct 27, 2025

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

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 27, 2025
@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 27, 2025
@auto-submit auto-submit bot merged commit 082bd44 into flutter:flutter-3.38-candidate.0 Oct 27, 2025
168 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants