-
Notifications
You must be signed in to change notification settings - Fork 37.7k
util: Revert back MoveFileExW
call for MinGW-w64
#24331
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
Conversation
343002e
to
15a043d
Compare
What version is broken? Is there an upstream issue / bug report? |
Does the unit test fail on current master? I am surprised to see that native windows and windows cross builds in the CI pass on current master with the presumed bug included. |
Ah, it fails: https://cirrus-ci.com/task/6670169794674688?logs=ci#L4536 Concept ACK |
Good catch… Leave it to windows libraries to not actually implement the standard as it is defined. |
At one point it might be better to drop support for mingw and use clang instead for cross compiling. With all the bugs we are seeing and other projects moving to clang I am not convinced this is a good long term choice anymore. |
I didn't realize the bug was Mingw only. So MSVC (or even clang) implements this correctly?
Agree. If it's less buggy than mingw-w64, I think it would be good to consider using clang for the windows build in a future release. |
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.
ACK 15a043d
mingw32 works ok? Or we don't support that? |
The latter, I guess. |
15a043d
to
4d92107
Compare
Updated 15a043d -> 4d92107 (pr24331.01 -> pr24331.02, diff): |
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.
ACK 4d92107
|
afaik mingw-w64 was a fork years ago because mingw32 wasn't really maintained anymore, i doubt they support newer C++ standards required Edit: wait, i'm confused here (the confusing naming of the projects is the gift that keeps giving), it's very possible that mingw-w64 defines |
AFAIK,
Yeap :) |
4d92107
to
40eb42d
Compare
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
40eb42d
to
dc01cbc
Compare
Updated 4d92107 -> dc01cbc (pr24331.02 -> pr24331.03, diff): |
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.
ACK dc01cbc
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
FWIW there's a comment in the source
|
dc01cbc test: Add fs_tests/rename unit test (Hennadii Stepanov) d4999d4 util: Revert back MoveFileExW call for MinGW-w64 (Hennadii Stepanov) Pull request description: Unfortunately, bitcoin#24308 introduced a [regression](bitcoin#24308 (comment)) for mingw builds. The root of the problem is a broken implementation of [`std::filesystem::rename`](https://en.cppreference.com/w/cpp/filesystem/rename). In particular, the expected behavior > If `old_p` is a non-directory file, then `new_p` must be ... existing non-directory file: `new_p` _is first deleted_... fails with the "File exists" error. This PR reverts back the `MoveFileExW` call, and adds the [suggested](bitcoin#24308 (review)) unit test. ACKs for top commit: vasild: ACK dc01cbc Tree-SHA512: c8e5a98844cfa32bec0ad67a1aaa58fe2efd0c5474d3e83490211985b110f83245758a742dcaa0a933a192ab66a7f11807e0c53ae69260b7dd02fc99f6d03849
Unfortunately, #24308 introduced a regression for mingw builds.
The root of the problem is a broken implementation of
std::filesystem::rename
. In particular, the expected behaviorfails with the "File exists" error.
This PR reverts back the
MoveFileExW
call, and adds the suggested unit test.