Open DanTup opened 3 months ago
/cc @brianquinlan
@brianquinlan please let me know if there's anything I can to help get any more info to help track this down. It's affecting quite a lot of users according to my (admittedly limited) stats so I'm keen to try and fix, but right now I don't have any ideas for either debugging further or trying to workaround/avoid it.
This might not be a Dart issue, but since changing the Dart script for a NodeJS script seems to cause the issue to go away I wonder if there might at least be someone who might have a better grasp of what's happening here (I feel I've hit the limits of what I can debug).
While the title sounds quite specific, those variables all appear to be required. Some background:
flutter daemon
to start the Flutter daemon device daemon, which it communicates with overstdin
/stdout
to get notifications of devices being connected/disconnected (plus some other stuff useful to the editor that is implemented in theflutter
tool)flutter
shell script runsgit
as part of setting up the Dart SDK before it can run theflutter_tools
Dart programThe issue we're seeing is when the version of
git
the user has onPATH
comes from msys2. In this case, when theflutter_tools
daemon starts, it gets some input fromstdin
from the client, but thenstdin
appears to close and no more input is received. The VS Code extension (NodeJS script) does not see anything change, and continues to send messages over the daemon'sstdin
but they are never received (and never responded to).The issue only occurs when:
.bat
file runs any program frommsys2
prior to running the Dart scriptI've created a repro with some steps here:
https://github.com/DanTup/repro-dart-code-4840
To reproduce, you'll need to be on Windows and have NodeJS and a copy of msys2 (which you can download as a self-extracting archive, it doesn't need installing - you just need to be able to run any of the
.exe
files from it in thefake_flutter.bat
script).The odd behaviour is almost certainly coming from msys2, but it's odd that when the daemon script is NodeJS this issue doesn't occur. This makes me wonder what Dart is seeing happen that causes it to fire the
done
handler forstdin
(and not get any further input).Related issues: