-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Add Qt programs to msvc build (updated, no code changes) #15529
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
|
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. |
fanquake
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.
Concept ACK
My tentative solution is to build locally and upload the binaries as a github release. The msvc build is only for testing and tinkering but even so this doesn't feel like the ideal solution. Open to suggestions?
If this download is required, we can always host it on a more "official" repo etc.
|
Concept ACK Thanks for doing this! Diversity in testing is good! |
|
Concept ACK. And the qt and vcpkg path could be arguments in msvc-autogen.py to generate the project file, so that the users could build qt on their own computer. like: |
I did spot that but I'm pretty sure the appveyor Qt builds are dynamic linking and therefore incompatible with the static linking builds for all the other bitcoin core libraries.
That's a good idea. I think I can consolidate the location to set global properties to the |
|
There are lots of warnings for the msvc build of libbitcoin_qt. A lot are generated from the Qt code templates however there is one that looks a bit nasty: The culprit method |
|
Concept ACK, I did get bitcoin-qt to build once on MSVC in 2012 or so so, and know how much trouble it is I feel your pain. |
751da0c to
5502529
Compare
|
PR no longer work in progress and ready for review. |
|
ping @ken2812221. |
ken2812221
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.
Nice work!!
build_msvc/msvc-autogen.py
Outdated
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 would prefer to use shutil to copy the files. Also, use absolute file path instead.
.appveyor.yml
Outdated
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 WholeProgramOptimization is to make sure that the generated cache is not too big to reduce cache save/load time. I remember that the cache could be over 1GB without this setting so that we can't store it with free appveyor plan.
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 WholeProgramOptimization is off by default and I removed the cases where it was being set in individual project files.
.appveyor.yml
Outdated
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.
If you change the python code not to use regular expression. It could be single slash here.
|
Nit: A few of the files changed/added text files seem to be missing the expected |
cddccf6 to
997610f
Compare
c739577 to
ada5dd9
Compare
|
For anyone interested in testing this PR here are the bare minimum steps. First 6 are to download the required Qt5.9.7 static libraries. You can build Qt yourself (see the readme file in this PR) but that will a LOT of effort, @NicolasDorier hint hint. |
|
Thanks @sipsorcery. I'll be testing this again tomorrow. |
fanquake
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.
build_msvc/README.md
Outdated
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.
double-conversion is missing here
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.
Thanks for reviewing! The secp256k1 and leveldb packages aren't required anymore either since they're now included as source projects. I'll fix it up.
|
@sipsorcery Looks like the windows build files might need some updates for recent changes: Build FAILED.
"C:\projects\bitcoin\build_msvc\bitcoin.sln" (default target) (1) ->
"C:\projects\bitcoin\build_msvc\bitcoin-qt\bitcoin-qt.vcxproj" (default target) (22) ->
(Link target) ->
libbitcoin_qt.lib(walletcontroller.obj) : error LNK2001: unresolved external symbol "public: __cdecl CreateWalletDialog::CreateWalletDialog(class QWidget *)" (??0CreateWalletDialog@@QEAA@PEAVQWidget@@@Z) [C:\projects\bitcoin\build_msvc\bitcoin-qt\bitcoin-qt.vcxproj]
libbitcoin_qt.lib(walletcontroller.obj) : error LNK2001: unresolved external symbol "public: class QString __cdecl CreateWalletDialog::walletName(void)const " (?walletName@CreateWalletDialog@@QEBA?AVQString@@XZ) [C:\projects\bitcoin\build_msvc\bitcoin-qt\bitcoin-qt.vcxproj]
libbitcoin_qt.lib(walletcontroller.obj) : error LNK2001: unresolved external symbol "public: bool __cdecl CreateWalletDialog::encrypt(void)const " (?encrypt@CreateWalletDialog@@QEBA_NXZ) [C:\projects\bitcoin\build_msvc\bitcoin-qt\bitcoin-qt.vcxproj]
libbitcoin_qt.lib(walletcontroller.obj) : error LNK2001: unresolved external symbol "public: bool __cdecl CreateWalletDialog::disablePrivateKeys(void)const " (?disablePrivateKeys@CreateWalletDialog@@QEBA_NXZ) [C:\projects\bitcoin\build_msvc\bitcoin-qt\bitcoin-qt.vcxproj]
libbitcoin_qt.lib(walletcontroller.obj) : error LNK2001: unresolved external symbol "public: bool __cdecl CreateWalletDialog::blank(void)const " (?blank@CreateWalletDialog@@QEBA_NXZ) [C:\projects\bitcoin\build_msvc\bitcoin-qt\bitcoin-qt.vcxproj]
C:\projects\bitcoin\build_msvc\x64\Release\bitcoin-qt.exe : fatal error LNK1120: 5 unresolved externals [C:\projects\bitcoin\build_msvc\bitcoin-qt\bitcoin-qt.vcxproj]
0 Warning(s)
6 Error(s)
Time Elapsed 00:19:58.92
Command exited with code 1 |
|
@fanquake yep I'm on it. |
fanquake
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.
re-ACK 1619684 - AppVeyor looks ok now.
1619684 Added libbitcoin_qt and bitcoin-qt to the msbuild configuration. (Aaron Clauson) Pull request description: This PR has ~~90%~~ all of the work done to allow the bitcoin Qt programs to be built with msvc and the appveyor script. Outstanding issues: - ~~There are ~~3~~ ~~6~~ 5 code tweaks required for the bitcoin Qt components to be built without warnings with msvc. They seem minor~~, - Building Qt as a static library for Windows is painful and time consuming. I doubt it will ever be possible to build Qt from source as part of an appveyor job (and it would probably take over an hour even if it was). My tentative solution is to build locally and upload the binaries as a [github release](https://github.com/sipsorcery/qt_win_binary/releases). The msvc build is only for testing and tinkering but even so this doesn't feel like the ideal solution. Open to suggestions? - ~~There is still an issue to sort out with the payment request URL handling. Building Qt with openssl is an extra headache. I will continue to work on getting this working.~~ The big benefit of this PR is the ability to run bitcoin-qt within a Visual Studio debugging session which could expedite tracking down issues on Windows. On a side note the test-bitcoin-qt tests fail very early, probably due to *nix specific tests. I haven't dug into them at this point. **Update 28 Jun 2019**: The ENABLE_BIP70 option is now off (it's flagged for removal as per #15584). With it disabled msbuild does not require any code changes to build the Bitcoin Core Qt applications. ACKs for top commit: fanquake: re-ACK 1619684 - AppVeyor looks ok now. Tree-SHA512: c0d3fd53b3ff99096b2505d519ed5ca6791bc4bce77addf9c520dc042eec5980a51a1fb9f0aa72e9cc53773085c43218793ca7a915a47806a3a1ffb84d9409f9
…changes) 1619684 Added libbitcoin_qt and bitcoin-qt to the msbuild configuration. (Aaron Clauson) Pull request description: This PR has ~~90%~~ all of the work done to allow the bitcoin Qt programs to be built with msvc and the appveyor script. Outstanding issues: - ~~There are ~~3~~ ~~6~~ 5 code tweaks required for the bitcoin Qt components to be built without warnings with msvc. They seem minor~~, - Building Qt as a static library for Windows is painful and time consuming. I doubt it will ever be possible to build Qt from source as part of an appveyor job (and it would probably take over an hour even if it was). My tentative solution is to build locally and upload the binaries as a [github release](https://github.com/sipsorcery/qt_win_binary/releases). The msvc build is only for testing and tinkering but even so this doesn't feel like the ideal solution. Open to suggestions? - ~~There is still an issue to sort out with the payment request URL handling. Building Qt with openssl is an extra headache. I will continue to work on getting this working.~~ The big benefit of this PR is the ability to run bitcoin-qt within a Visual Studio debugging session which could expedite tracking down issues on Windows. On a side note the test-bitcoin-qt tests fail very early, probably due to *nix specific tests. I haven't dug into them at this point. **Update 28 Jun 2019**: The ENABLE_BIP70 option is now off (it's flagged for removal as per bitcoin#15584). With it disabled msbuild does not require any code changes to build the Bitcoin Core Qt applications. ACKs for top commit: fanquake: re-ACK 1619684 - AppVeyor looks ok now. Tree-SHA512: c0d3fd53b3ff99096b2505d519ed5ca6791bc4bce77addf9c520dc042eec5980a51a1fb9f0aa72e9cc53773085c43218793ca7a915a47806a3a1ffb84d9409f9
This part of the build system has been removed in bitcoin#15529 and thus no longer needs to be updated.
8d841ad doc: Remove MSVC update step from translation process (Wladimir J. van der Laan) Pull request description: This part of the build system has been removed in #15529 and thus no longer needs to be updated. ACKs for top commit: MarcoFalke: ACK 8d841ad sipsorcery: ACK 8d841ad Tree-SHA512: f561a6b1da806e8868a265c77725b94fabef60bc7b9d401e3f70c3d859323adc2e204e3d6fbfea4f1ff86e70667f8bd01157411106ea93974921c02d874e0083
…ocess 8d841ad doc: Remove MSVC update step from translation process (Wladimir J. van der Laan) Pull request description: This part of the build system has been removed in bitcoin#15529 and thus no longer needs to be updated. ACKs for top commit: MarcoFalke: ACK 8d841ad sipsorcery: ACK 8d841ad Tree-SHA512: f561a6b1da806e8868a265c77725b94fabef60bc7b9d401e3f70c3d859323adc2e204e3d6fbfea4f1ff86e70667f8bd01157411106ea93974921c02d874e0083
This part of the build system has been removed in bitcoin#15529 and thus no longer needs to be updated.

This PR has
90%all of the work done to allow the bitcoin Qt programs to be built with msvc and the appveyor script.Outstanding issues:
There are,365 code tweaks required for the bitcoin Qt components to be built without warnings with msvc. They seem minorThere is still an issue to sort out with the payment request URL handling. Building Qt with openssl is an extra headache. I will continue to work on getting this working.The big benefit of this PR is the ability to run bitcoin-qt within a Visual Studio debugging session which could expedite tracking down issues on Windows.
On a side note the test-bitcoin-qt tests fail very early, probably due to *nix specific tests. I haven't dug into them at this point.
Update 28 Jun 2019: The ENABLE_BIP70 option is now off (it's flagged for removal as per #15584). With it disabled msbuild does not require any code changes to build the Bitcoin Core Qt applications.