doc: Replace a link to Qt precompiled binaries with compile instructions #22890

pull hebasto wants to merge 3 commits into bitcoin:master from hebasto:210904-msvc changing 3 files +34 −36
  1. hebasto commented at 0:04 am on September 5, 2021: member
    This PR replaces a link to Qt precompiled binaries with compile instructions that allow users to self-compile static Qt package which is required for building Bitcoin Core with Visual Studio.
  2. hebasto added the label Build system on Sep 5, 2021
  3. hebasto added the label Docs on Sep 5, 2021
  4. hebasto added the label Windows on Sep 5, 2021
  5. hebasto commented at 0:05 am on September 5, 2021: member
  6. hebasto force-pushed on Sep 5, 2021
  7. DrahtBot commented at 2:44 am on September 5, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    No conflicts as of last run.

  8. sipsorcery commented at 8:33 am on September 5, 2021: member

    @hebasto concept ACK on the doc changes.

    Changing the Qt path to C:\Qt_static has the potential to make it trickier to switch between Qt versions, however, I suspect that may be a problem specific to me.

  9. hebasto force-pushed on Sep 5, 2021
  10. hebasto force-pushed on Sep 5, 2021
  11. hebasto commented at 11:21 am on September 5, 2021: member

    Updated 7b8b6c80384f99c7ca864c821e1b967a4505c185 -> ecb823e4b0eb2bfab43fc964278a18ebcdf46b5e (pr22890.01 -> pr22890.02, diff):

    Changing the Qt path to C:\Qt_static has the potential to make it trickier to switch between Qt versions, however, I suspect that may be a problem specific to me.

    Now a non-default path to static Qt could specified in the QTBASEDIR environment variable.

  12. hebasto force-pushed on Sep 5, 2021
  13. hebasto commented at 1:26 pm on September 5, 2021: member

    Updated ecb823e4b0eb2bfab43fc964278a18ebcdf46b5e -> 42df8d519d20897dabb3ca07eec6769304d1ff37 (pr22890.02 -> pr22890.03, diff):

  14. hebasto force-pushed on Sep 5, 2021
  15. hebasto commented at 2:36 pm on September 5, 2021: member

    Updated 42df8d519d20897dabb3ca07eec6769304d1ff37 -> 8e9410f188e1fa12cdd5b5b5bae4df8445cd385e (pr22890.03 -> pr22890.04, diff):

    • dropped -ltcg configure option because link-time code generation significantly (at times) increases the required disc space, and it should not be suggested to users by default.
  16. in build_msvc/README.md:8 in 8e9410f188 outdated
     2@@ -3,67 +3,72 @@ Building Bitcoin Core with Visual Studio
     3 
     4 Introduction
     5 ---------------------
     6-Solution and project files to build the Bitcoin Core applications `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work).
     7+Solution and project files to build the Bitcoin Core with applications `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work).
     8 
     9-Building with Visual Studio is an alternative to the Linux based [cross-compiler build](https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md).
    10+To build Bitcoin Core from a command-line interface, it is sufficient to install the Build Tools component only.
    


    jarolrod commented at 3:43 pm on September 5, 2021:
    0To build Bitcoin Core from the command-line, it is sufficient to only install the Visual Studio Build Tools component.
    

    hebasto commented at 5:17 pm on September 5, 2021:
    Thanks! Updated.
  17. in build_msvc/README.md:6 in 8e9410f188 outdated
    2@@ -3,67 +3,72 @@ Building Bitcoin Core with Visual Studio
    3 
    4 Introduction
    5 ---------------------
    6-Solution and project files to build the Bitcoin Core applications `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work).
    7+Solution and project files to build the Bitcoin Core with applications `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work).
    


    jarolrod commented at 4:13 pm on September 5, 2021:

    while here, some slight cleanups would be nice.

    0Solution and project files to build Bitcoin Core with `msbuild` or Visual Studio can be found in the `build_msvc` directory. The build has been tested with Visual Studio 2019 (building with earlier versions of Visual Studio should not be expected to work).
    

    hebasto commented at 5:17 pm on September 5, 2021:
    Thanks! Updated.
  18. in build_msvc/README.md:38 in 8e9410f188 outdated
    53 Qt
    54 ---------------------
    55-In order to build Bitcoin Core a static build of Qt is required. The runtime library version (e.g. v142) and platform type (x86 or x64) must also match.
    56+To build Bitcoin Core with the GUI, a static build of Qt is required.
    57+
    58+1. Download a single ZIP archive of Qt source from https://download.qt.io/official_releases/qt/ (e.g., [`qt-everywhere-src-5.12.11.zip`](https://download.qt.io/official_releases/qt/5.12/5.12.11/single/qt-everywhere-src-5.12.11.zip)), and expand it into a dedicated folder. In this document it is assumed that this folder is `C:\dev\qt-source`.
    


    jarolrod commented at 4:51 pm on September 5, 2021:

    “Qt source” -> “Qt source code” is just a nit

    01. Download a single ZIP archive of Qt source code from https://download.qt.io/official_releases/qt/ (e.g., [`qt-everywhere-src-5.12.11.zip`](https://download.qt.io/official_releases/qt/5.12/5.12.11/single/qt-everywhere-src-5.12.11.zip)), and expand it into a dedicated folder. The following instructions assume that this folder is `C:\dev\qt-source`.
    

    hebasto commented at 5:17 pm on September 5, 2021:
    Thanks! Updated.
  19. jarolrod commented at 4:53 pm on September 5, 2021: member

    Some notes on wording, I will test for correctness of instructions later.

    Prepares hazmat suit to enter the windows environment

  20. hebasto force-pushed on Sep 5, 2021
  21. hebasto commented at 5:16 pm on September 5, 2021: member

    Updated 8e9410f188e1fa12cdd5b5b5bae4df8445cd385e -> c948757c99c5e1c80d4edc1ab201ef93b7803d70 (pr22890.04 -> pr22890.05, diff):

  22. in build_msvc/README.md:65 in c948757c99 outdated
    90 
    91-- An optional step is to adjust the settings in the `build_msvc` directory and the `common.init.vcxproj` file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set.
    92+2. An optional step is to adjust the settings in the `build_msvc` directory and the `common.init.vcxproj` file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set. To specify a non-default path to a static Qt package directory, use the `QTBASEDIR` environment variable.
    93 
    94-- To build from the command line with the Visual Studio 2019 toolchain use:
    95+3. To build from the command line with the Visual Studio 2019 toolchain use:
    


    jarolrod commented at 9:01 pm on September 5, 2021:

    sorry, another nit (for consistency). Apply only when you need to retouch for a good reason

    03. To build from the command-line with the Visual Studio 2019 toolchain use:
    
  23. fanquake commented at 2:03 am on September 6, 2021: member
    There’s no point adding the patching instructions in 9a434e81f8dd5c1b97442ba1cbb521856d8375b3, just to drop them in a later commit (c948757c99c5e1c80d4edc1ab201ef93b7803d70).
  24. hebasto force-pushed on Sep 6, 2021
  25. hebasto commented at 3:58 am on September 6, 2021: member

    Updated c948757c99c5e1c80d4edc1ab201ef93b7803d70 -> 0f56ce36483f01da8ed2b6b35a3484649cfe5d7d (pr22890.05 -> pr22890.06, diff):

  26. in build_msvc/README.md:74 in 0f56ce3648 outdated
    102 
    103-- Alternatively, open the `build_msvc/bitcoin.sln` file in Visual Studio 2019.
    104+Alternatively, open the `build_msvc/bitcoin.sln` file in Visual Studio 2019.
    105 
    106 AppVeyor
    107 ---------------------
    


    sipsorcery commented at 8:33 pm on September 6, 2021:
    I guess the AppVeyor section will be removed when #21551 gets merged?

    hebasto commented at 9:32 am on September 7, 2021:
    Rebased on top of #21551.
  27. hebasto force-pushed on Sep 7, 2021
  28. hebasto commented at 9:31 am on September 7, 2021: member
    Rebased 0f56ce36483f01da8ed2b6b35a3484649cfe5d7d -> 391a377fc9a7261a2f73221150c599adf7076fa9 (pr22890.06 -> pr22890.07) due to the conflict with #21551.
  29. MarcoFalke referenced this in commit ecf580e40f on Sep 7, 2021
  30. DrahtBot added the label Needs rebase on Sep 7, 2021
  31. sidhujag referenced this in commit 37c78cbdbc on Sep 7, 2021
  32. build: Make <QtBaseDir> default name Qt and VS versions agnostic
    This change allows users to not patch `common.qt.init.vcxproj` to fit
    their Qt and Visual Studio versions. Also it simplifies code base
    maintaining.
    
    To specify a non-default path, the QTBASEDIR environment variable can be
    used.
    5e42f2ad26
  33. hebasto force-pushed on Sep 7, 2021
  34. hebasto commented at 7:32 pm on September 7, 2021: member
    Rebased 391a377fc9a7261a2f73221150c599adf7076fa9 -> 367203bc93a9016519221e4b88fc2b1b13d91279 (pr22890.07 -> pr22890.08) due to the conflict with #22899.
  35. DrahtBot removed the label Needs rebase on Sep 7, 2021
  36. laanwj commented at 2:37 pm on September 9, 2021: member

    that allow users to self-compile static Qt package which is required for building Bitcoin Core with Visual Studio.

    Why is a static Qt package necessarily needed? I mean, on Linux it works fine to build it against a dynamic system Qt.

  37. hebasto commented at 2:51 pm on September 9, 2021: member

    @laanwj

    that allow users to self-compile static Qt package which is required for building Bitcoin Core with Visual Studio.

    Why is a static Qt package necessarily needed? I mean, on Linux it works fine to build it against a dynamic system Qt.

    A relevant discussion from #15529:

    @NicolasDorier #15529 (comment):

    Btw, would it be a good idea to use QT’s precompiled dynamic library instead of the static lib? We are using the msvc build mainly for debugging stuff so I don’t think it would matter too much and prevent a bunch of headache. @sipsorcery #15529 (comment) @NicolasDorier nooooo :(. You don’t want to know how long I’ve spent getting the Qt build working.

    Putting aside the lost chunk of my life it would be a big change switching the build to dynamic linking. All the Bitcoin Core libraries would have to be built as dll’s and there are then bound to be missing exports that will need to be added which would mean code changes.

    I’d highly recommend sticking with static linking for consistency with the other Bitcoin Core builds. Hopefully one day the vcpkg static build of Qt will work and allow it to be treated the same as the other dependencies for the msvc build. See microsoft/vcpkg#4560 (comment).

  38. sipsorcery commented at 9:17 pm on September 9, 2021: member

    Why is a static Qt package necessarily needed? I mean, on Linux it works fine to build it against a dynamic system Qt.

    To further elaborate, to the best of my knowledge a static version of Qt is required for the Bitcoin Core version on Windows because we want the bitcoin-qt.exe and other executables to be statically linked against the C runtime (the MT compiler option).

    The msvc compiler options page also has this quote:

    All modules passed to a given invocation of the linker must have been compiled with the same run-time library compiler option (/MD, /MT, /LD).

    I was never able to build bitcoim-qt.exe with a version of Qt compiled with the MD compiler option but perhaps I’m missing something.

  39. laanwj commented at 3:09 pm on September 16, 2021: member

    OK, thanks for explaining, I was under the impression it was something new introduced here, but if it’s simply the way things have always been…“it’s a lot of extra work” is enough reason to not do it imo. FWIW, on Linux it’s the othe way around, dynamically building is “go with the flow” whereas static is what requires a lot of extra work.

    Concept ACK

  40. in build_msvc/README.md:18 in 367203bc93 outdated
    26-A number of [open source libraries](https://github.com/bitcoin/bitcoin/blob/master/doc/dependencies.md) are required in order to be able to build Bitcoin Core.
    27+To build [dependencies](../doc/dependencies.md) (except for [Qt](#qt)),
    28+the default approach is to use the [vcpkg](https://docs.microsoft.com/en-us/cpp/vcpkg) package manager from Microsoft.
    29 
    30-Options for installing the dependencies in a Visual Studio compatible manner are:
    31+To install vcpkg:
    


    fanquake commented at 6:17 am on September 30, 2021:
    Please don’t add instructions for installing a package manager here. It’s got nothing todo with building Bitcoin Core, and is just another thing that can become outdated. Linking to upstream (https://github.com/Microsoft/vcpkg), where the instructions will always be correct, should be sufficient, and is what was being done previously.

    hebasto commented at 8:11 am on September 30, 2021:
    Thanks! Updated.
  41. hebasto force-pushed on Sep 30, 2021
  42. doc: Replace a link to Qt precompiled binaries with compile instructions c4139f06a9
  43. doc: Suggest using jom instead of nmake 6bc4398937
  44. hebasto force-pushed on Sep 30, 2021
  45. hebasto commented at 8:10 am on September 30, 2021: member

    Updated 367203bc93a9016519221e4b88fc2b1b13d91279 -> 6bc43989372386bf1dc6ee2a763a46a2d0780059 (pr22890.08 -> pr22890.09, diff):

  46. hebasto commented at 7:27 pm on October 6, 2021: member

    @sipsorcery

    Mind looking into this PR one more time?

  47. sipsorcery commented at 7:32 pm on October 6, 2021: member
    ACK 6bc43989372386bf1dc6ee2a763a46a2d0780059.
  48. fanquake merged this on Oct 7, 2021
  49. fanquake closed this on Oct 7, 2021

  50. hebasto deleted the branch on Oct 7, 2021
  51. sidhujag referenced this in commit a38086db6d on Oct 7, 2021
  52. DrahtBot locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me