-
Notifications
You must be signed in to change notification settings - Fork 6k
Windows: Fix fml::GetFullHandlePath for WINUWP target #24422
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. 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. |
a17e18a
to
7dc3266
Compare
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 has a number of issues:
- Access to the map is not thread-safe. These APIs can be accessed on any thread.
- The map may be keyed by handles that have been closed. If handles are reused in the process, this will lead to incorrect results.
- The map will grow indefinitely.
What is the error returned on UWP when the lookup fails? We may be able to tackle this in a more elegant way. If not, a bespoke implementation of file_win
or a rethinking of assumptions about being able to lookup file names from handles would likely be necessary.
The error returned is access denied. This may be a Windows bug since the directory in question is within the assets path of the app, and win32 operations are supposed to be supported in there but it's a moot point since it is clearly bust and we need to work around it.
To stand up UWP, hoping to avoid a big refactor here so looking for the least bad solution. |
@chinmaygarde to address 3) in your list above I'm considering the following approach
Before I go too far building this, does that in conjunction with the previous commit satisfy your criteria of fixing the issues and sufficiently elegant approach? |
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.
Since this is the bringup of UWP, would you prefer filing bugs for such issues instead? I don't want insist of large API reworks while you are in the process of quickly tackling each minor UWP specific issue. We can file a bug and tag it such that we ensure we get to it before declaring this variant stable. I am not sure how close you are to getting this variant working though.
I am not comfortable with global locks around the map but other than that, this seems to adequately handle the concerns I listed.
I didn't get the tests done yesterday and will be offline today. I'll get those done tomorrow. Keen to get this in by EOD tomorrow if at all possible, hence LMK what else needed to land. Thx again for the review. |
Confirmed that new code is completely covered by existing tests. Please review comments and LMK if you have any more feedback. |
Sorry, I haven't been able to get to this on my Windows workstation to figure out why the static inlines were necessary in the header. I'll address this over the weekend. |
@clarkezone I haven't had a chance to reproduce on Windows yet. @cbracken If you have a setup ready, will be you able to take a look please? If not, depending on the urgency of this issue, we can land it now and followup on a fix for it via a bug. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
1 similar comment
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
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.
Added a patch with the fix for the linker issue. Thanks for your patience on this @clarkezone!
The statics were declared in the header but never defined in a translation unit.
a824100
to
641c0a7
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
1 similar comment
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
Only change was to rebase to tip of tree. CLAs are still fine. |
This pull request is not suitable for automatic merging in its current state.
|
Co-authored-by: Chris Bracken <chris@bracken.jp>
Co-authored-by: Chris Bracken <chris@bracken.jp>
Co-authored-by: Chris Bracken <chris@bracken.jp>
Although the documentation claims that GetFinalPathNameByHandle is supported for UWP apps, turns out it does not work correctly hence the need to workaround by maintaining a map of file handles to absolute paths in order to be able to satisfy GetFullHandlePath for the WINUWP target.
flutter/flutter#14967
flutter/flutter#70196
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.