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
Reintroduce external signer support for Windows #29868
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
cf6a4b2
to
5e50b3d
Compare
Looks like there are now? |
c05204c
to
718e11c
Compare
Rebased. |
718e11c
to
a0f3fc9
Compare
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
a0f3fc9
to
0202082
Compare
Rebased on top of the merged #29910. |
src/util/subprocess.h
Outdated
@@ -1012,7 +1008,7 @@ class Popen | |||
/* | |||
~Popen() | |||
{ | |||
#ifdef __USING_WINDOWS__ |
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.
#29961 removes this, that's the only conflict I found.
Tested the Guix build on Windows 11. Code changes look reasonable, but Windows stuff is not my expertise... |
0202082
to
db73ac8
Compare
Rebased to resolve conflicts with the merged #29774. |
cc @sipsorcery :) |
Concept ACK |
// https://www.winehq.org/pipermail/wine-devel/2008-September/069387.html | ||
auto hntdll = GetModuleHandleA("ntdll.dll"); | ||
assert(hntdll); | ||
const bool wine_runtime = GetProcAddress(hntdll, "wine_get_version"); |
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 check will fail on Windows. I'm guessing that's expected but just checking?
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.
The goal is to detect that binaries, which are cross-compiled for Windows, are running in Wine.
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.
Does that mean this PR is intended to be a fix for Windows or for wine?
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.
For both. Wine is used to run test suite on Linux after cross-compiling for Windows. This need roots from the fact that Wine and Windows runtimes produce different error messages:
bitcoin/src/test/system_tests.cpp
Line 80 in db73ac8
const std::string expected{wine_runtime ? "File not found." : "File Not Found"}; |
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.
FWIW, the same behaviour was before #29489.
db73ac8
to
83c6332
Compare
Rebased on top of the merged #29961. |
Briefly retested 83c6332 which still works. |
83c6332
to
9353a31
Compare
Rebased due to the conflict with merged #29494. |
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
https://github.com/bitcoin/bitcoin/pull/29868/checks?check_run_id=24699627882: In file included from common/run_command.cpp:13:
./util/subprocess.h: In member function ‘int subprocess::Popen::wait()’:
./util/subprocess.h:1062:7: error: unused variable ‘ret’ [-Werror=unused-variable]
1062 | int ret = WaitForSingleObject(process_handle_, INFINITE);
| ^~~ |
9353a31
to
b69b9e8
Compare
I assume you added b69b9e8 because it no longer uses an external dependency? Is there something you can remove from cpp-subprocess based on your comment? #29961 (comment) |
It's there because setting something that is already on, to on, is pointless, and doesn't test anything. In either case, external signer is also not special, so it's not clear why, as a feature, it's being explcitly enabled in the global CI config. |
|
At some point, we might want to get rid of the |
5a11d30 refactor, subprocess: Remove unused stream API calls (Hennadii Stepanov) 05b6f87 refactor, subprocess: Remove unused `Popen::child_created_` data member (Hennadii Stepanov) 9e1ccf5 refactor, subprocess: Remove unused `Popen::poll()` (Hennadii Stepanov) 24b53fc refactor, subprocess: Remove `Popen::pid()` (Hennadii Stepanov) Pull request description: This PR continues #29961. Please note that `Popen::poll()` is not required for #29868 anymore. ACKs for top commit: theuni: Easy code review ACK 5a11d30 since it's all removals :) theStack: Code-review ACK 5a11d30 Tree-SHA512: 11f984f8384c337782d058afa80011e88087a1b5a3ed6e4678d492e6c232b706a26312463c5dd8c529aa477497c8afca9f54574e0e36e3edd5675bd5d8424bbb
This behavior is expected and consistent with the non-Windows implementation. The code is borrowed from `Popen::poll()`.
The `WIN32` macro is used across the entire code base to designate building for Windows.
This option is enabled by default.
b69b9e8
to
0783589
Compare
Rebased due to the conflict with merged #30081. |
Based on upstream arun11299/cpp-subprocess#99.
Partially reverts:
system_tests/run_command
#29489After this PR, we can proceed to actually remove the unused code from
src/util/subprocess.hpp
.