-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Fix flutter tool crash on upgrade caused by app-jit #111879
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
Fix flutter tool crash on upgrade caused by app-jit #111879
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
I like this approach but CI does not :) |
Interesting. It works on my Windows box --- I'll try some print-debugging on the bot =) |
I think we're good now. |
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.
LGTM
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.
This works for me on Linux & Windows, so LGTM
In #111459 we started using app-jit for flutter_tool to improve startup performance. In the PR there was talks about it having been tried before, but been reverted for some reason no one remembered.
I digged a bit and found the revert #30204 which pointed me to #30203 saying that
flutter upgrade
crashed.And sure enough that is still the case (at least on Linux):
What's happening is this:
flutter upgrade
flutter
. Notice how this is after git has fetched the new data, so a new tool snapshot is built; also notice how the "original" ("top-most" if you will)flutter
is still running.This PR fixes the issue by applying the same strategy as is applied for the dart_sdk path when upgrading dart: nothing is overwritten, it's moved and then later deleted. (technically just deleting it seems to work too, but if - for whatever reason - the file should be in use we don't want it to fail).
This way the data dart is currently using to run the "top most"
flutter
still exists and the process doesn't crash.