This reproduces the issue described in:
The issue appears to occur on Windows when the git
in PATH
is from
msys2. Although the call to git appears to work just
the same as a standard Windows Git, when the daemon is spawned, the stdin stream
closes almost immediately, and the daemon no longer gets any input sent from
the IDE.
daemon_client_run_me.js
- the entry script which plays the part of Dart-Code. It spawns the fake Flutter daemon and repeatedly sends messages to it.daemon_client_run_me.dart
- a Dart version of the entry script which does not reproduce the issue (see additional notes below).fake_flutter.bat
- the fakeflutter.bat
file which includes a call togit
to check the revision of the Flutter SDK. The implementation here is simplified to just execute the command and not do anything with the result.fake_daemon.dart
- the fakeflutter daemon
which just echos back and input it gets, and prints when thestdin
stream closes.fake_daemon.js
- a Node version of the daemon script which does not reproduce the issue (see additional notes below).
- Update the two paths in
fake_flutter.bat
to point at a normal Windows version ofgit
and anmsys2
version ofgit
. Leave the native Windows version uncommented. - Run
node ./daemon_client_run_me.js
from the current folder. - Observe that
"Stream done! WERE YOU EXPECTING THIS?"
is NOT printed and the daemon response to each "Hello" message. - Swap to the
msys2
version ofgit
infake_flutter.bat
. - Run
node ./daemon_client_run_me.js
from the current folder. - Observe that
"Stream done! WERE YOU EXPECTING THIS?"
IS printed and the daemon no longer responds to each "Hello" message.
- The issue only seems to occur with the Node client
(
daemon_client_run_me.js
). The equivalent Dart code (daemon_client_run_me.dart
) does not seem to cause the issue. - The issue only seems to occur with the Dart daemon script
(
fake_daemon.dart
). The equivalent Node code (fake_daemon.js
) does not have the issue. - Removing the long wait at the end of
fake_daemon.dart
causes the process to exit in the failure case (with no errors), however in the case of the real Flutter daemon, the process does not exit (probably something else is keeping it alive). - The issue is not
git
-specific. Running any command frommsys2
seems to trigger the issue (for example, usingmsys64\usr\bin\cal.exe
in the.bat
).