-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[flutter_tools] handle windows holding file lock in web build directory #69115
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
[flutter_tools] handle windows holding file lock in web build directory #69115
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. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| ErrorHandlingFileSystem.deleteIfExists(outputDirectory, recursive: true); | ||
| outputDirectory.createSync(recursive: true); | ||
| } on FileSystemException catch (err) { | ||
| globals.logger.printError( |
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.
I think I'd rather crash than keep on trucking. The latter could lead to even harder to debug situations.
Since this function is async, can we print the issue and wait until the directory is unlocked? Pseudo-code:
bool deleted = false;
bool warningPrinted = false;
while (!deleted) {
try {
delete();
deleted = true;
} on FileSystemException {
if (!warningPrinted) {
globals.logger.printError('Directory $outputDirectory is locked by another program. Waiting for the directory to be unlocked.');
warningPrinted = true;
}
await Future.delayed(Duration(milliseconds: 50));
}
}
if (warningPrinted) {
globals.logger.printInfo('Directory $outputDirectory was unlocked and deleted. Continuing.');
}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 could definitely work, I was leaning towards the "quick fix" angle :)
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.
though I think the problem with this is that we will probably delete most of the files successfully, so that leaves a partially invalid state
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.
actually ... lets do a partial revert for now. this is causing crashes and I don't quite have the time I need for a long term solution
yjbanov
left a comment
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.

Description
Fixes #69109