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
Hot reloads fail and breakpoints may not be hit if breakpoint scriptUris are prefixed with file:// #18441
Comments
@aam not sure if you have an ideas on this? The format of these paths is not well defined but I think there really should be a common format that works for all types (VM, Flutter Test, Flutter Run, Flutter Run after Hot Reload). |
While trying to write an integration test for this, I found that this might be broken elsewhere too. If I send a breakpoint as a final String breakpoint = new Uri.file(fs.path.join(_tempDir.path, 'lib', 'main.dart')).toString();
// final String breakpoint = fs.path.join(_tempDir.path, 'lib', 'main.dart');
await isolate.addBreakpoint(breakpoint, 8); Depending on which one of those first two lines I uncomment, the test will either pass or time out (waiting for the isolate to pause). |
There's a failing test in |
Btw, I don't have a Linux machine locally to test, but on the CI it seems like this issue happens on macOS but not on Linux (seems to work fine on Linux). |
Our test that was hitting this on Windows seems to be passing now (see #21201 (comment)) so this may be macOS-only. |
@aam this appears to be not working on macOS. I have an open PR here: This changes the tests over to always using file URIs, however on macOS they fail. If you clone that branch on macOS you can repro by running |
Scratch that - I just re-read what the fix was (symlinks). Same thing may just need applying here - I'll see if I can make the fix it more general. |
Yep, same thing. Sorry for the bother! :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Currently when we send breakpoints from Dart Code we send each one in several different formats (local file system path,
package:
path, device-local path etc,) in an attempt to make sure we get the format the VM expects (since they're not well documented).I'm trying to remove some of these and clean it up because there are other issues when the breakpoints in the IDE and those in the VM don't map one-to-one. I'm trying to settle on sending file system paths in a single common format, specifically as "URIs" like:
file:///blah/blah
(macOS/Linux)file://C:/blah/blah
(Windows) Edit: Our test for this is passing on Windows now, so this may be macOS-onlyHowever, if I send breakpoints in this format on Windows then hot reloads will time out (specifically, the
PausePostRequest
comes in, then we delete/re-add breakpoints, then resume, but it never hits the berakpoint and the hot reload reports a timeout). If I send without thefile://
prefix it works fine. I think including thefile://
prefix is correct; the field is calledscriptUri
(and there are other complications elsewhere if I don't send them).Here are some logs of Flutter Run and Observatory for both with and without the prefixes. Here's how the end of the Flutter Run logs look:
With file:// prefix
Without file:// prefix
And here's what the Observatory log looks like after sending a resume after re-transmitting breakpoints:
Without file://
(it didn't hit a beakpoint, and the hot reload timed out)
Without file:// prefix
(the hot reload finished and the breakpoint was hit)
The text was updated successfully, but these errors were encountered: