CPack #33455

pull purpleKarrot wants to merge 7 commits into bitcoin:master from purpleKarrot:cpack changing 13 files +162 −302
  1. purpleKarrot commented at 2:28 pm on September 22, 2025: contributor

    The goal is to build all packages (both archives and installers) from a single configuration in CMake.

    Packaging Instruction

    Get a list of supported CPack generators for your platform with:

    0cpack --help
    

    Run cpack from the build directory after a successful build to select multiple package generators:

    0cmake --build .
    1cpack -G '7Z;NSIS64'
    

    Or build the package and/or package_source targets:

    0cmake --build . --target package
    1cmake --build . --target package_source
    

    TODO:

    • Windows start menu entries
    • Option to launch after install
    • Component descriptions / dependencies / groups
    • Auxiliary files (readme, config)
  2. DrahtBot commented at 2:28 pm on September 22, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33455.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #33585 (cmake: Use builtin support for .manifest files by purpleKarrot)
    • #33247 (build: Remove CMAKE_SKIP_BUILD_RPATH and SKIP_BUILD_RPATH settings by 151henry151)
    • #33142 (test: Run bench sanity checks in parallel with functional tests by maflcko)
    • #31974 (Drop testnet3 by Sjors)
    • #30595 (kernel: Introduce C header API by TheCharlatan)
    • #30437 (ipc: add bitcoin-mine test program by ryanofsky)

    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.

  3. hebasto commented at 1:05 pm on September 23, 2025: member

    Run cpack from the build directory after a successful build to select multiple package generators:

    0cmake --build .
    1cpack -G '7Z;NSIS64'
    

    Or build the package and/or package_source targets:

    0cmake --build . --target package
    1cmake --build . --target package_source
    

    Is the reproducibility of these commands guaranteed, or can it be enforced somehow?

    TODO:

    • Windows start menu entries

    • Option to launch after install

    • Component descriptions / dependencies / groups

    • Auxiliary files (readme, config)

    Adjust the Guix build script as well?

  4. in share/setup.nsi.in:56 in fe2dd036f4 outdated
    50-# Installer languages
    51-!insertmacro MUI_LANGUAGE English
    52-
    53-# Installer attributes
    54-InstallDir $PROGRAMFILES64\Bitcoin
    55-CRCCheck force
    


    fanquake commented at 3:32 pm on September 23, 2025:

    CRCCheck force

    Where are options like this being passed now?


    purpleKarrot commented at 6:56 am on September 25, 2025:

    CMake does not provide options for all NSIS attributes. For attributes that are strictly required, we may need to upstream support (see example).

    However, we should also reconsider whether deviating from the defaults is truly necessary.

    The default behavior for CRCCheck is to verify the CRC, but it also allows users to disable the check via a command-line option to the installer, which can be useful for testing purposes. Setting force removes that option. But what is the benefit? Does it provide any additional safety?

    The default BrandingText gives credit to the installer authors (quote: “so that everybody can know why the installer didn’t suck”). Is there a compelling reason to suppress this information?

    I do not observe any effect from XPStyle on Windows 11.

    The default behavior of ShowInstDetails is to display a loading bar with a “Show Details” button. This matches what users expect from other dialogs, such as file copying.


    fanquake commented at 10:12 am on October 13, 2025:

    CMake does not provide options for all NSIS attributes. For attributes that are strictly required,

    If migrating to do this the “CMake way” means less flexibility or giving up functionality because CMake doesn’t support something, that tradeoff that should be mentioned in the PR description. This also means that any future option we might want to use, may also require workarounds, assuming that CMake support for new options will lag NSIS releases by some amount (or not be added at all), and our minimum required/used-in-Guix CMake versions are not the latest available.

  5. fanquake commented at 10:12 am on October 13, 2025: member

    Adjust the Guix build script as well?

    Yea, this wont Guix build:

    0HOSTS="x86_64-w64-mingw32" ./contrib/guix/guix-build
    1<snip>
    2[100%] Built target bitcoin-qt
    3Running symbol and dynamic library checks...
    4[100%] Built target check-symbols
    5make: *** No rule to make target 'deploy'.  Stop.
    
  6. cmake: Make sure that install components are c identifiers
    The NSIS generator of CPack has issues with special characters
    in component names.
    See: https://gitlab.kitware.com/cmake/cmake/-/issues/19982
    751fd74900
  7. cmake: fix formatting of `install` command
    Make it more obvious that `DESTINATION` and `COMPONENT` are
    artifact-options for the same artifact-kind.
    59c38fe0bf
  8. cmake: remove INSTALL_MAN option 49f16c5824
  9. cmake: inline `install_binary_component` command f1112f2bba
  10. cmake: add CPack configuration 0e9a696351
  11. purpleKarrot force-pushed on Oct 14, 2025
  12. cmake: Use CPack to build Windows installer 4866a4f989
  13. wip ad41d4bcd9
  14. purpleKarrot force-pushed on Oct 14, 2025
  15. in share/setup.nsi.in:128 in ad41d4bcd9
    122-    DeleteRegValue HKCU "${REGKEY} (64-bit)" Path
    123-    DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)\Components"
    124-    DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)"
    125-
    126-    # Lingering since 77b2923f87131a407f7d4193c54db22375130403
    127-    Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin Core (testnet, 64-bit).lnk"
    


    hodlinator commented at 2:08 pm on October 15, 2025:

    How about porting over these parts from #33422?

    Should be added to the TODO list or some “Limitations” section in PR description, unless CPack has some way of magically finding renamed copies of the program and dealing with this.

  16. in contrib/guix/libexec/build.sh:262 in ad41d4bcd9
    257@@ -258,8 +258,8 @@ mkdir -p "$DISTSRC"
    258     # Make the os-specific installers
    259     case "$HOST" in
    260         *mingw*)
    261-            cmake --build build -j "$JOBS" -t deploy ${V:+--verbose}
    262-            mv build/bitcoin-win64-setup.exe "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
    263+            (cd build && cpack -G NSIS64 ${V:+--verbose})
    264+            mv build/BitcoinCore-*.exe "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
    


    fanquake commented at 2:29 pm on October 15, 2025:
    This would reintroduce the issue that #33158 worked around (#33126).

    purpleKarrot commented at 2:33 pm on October 15, 2025:
    Yes, ideally we should not rename the generated file but control how the generated file will be named in the first place.
  17. DrahtBot added the label Needs rebase on Nov 4, 2025
  18. DrahtBot commented at 5:32 pm on November 4, 2025: contributor
    🐙 This pull request conflicts with the target branch and needs rebase.

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: 2025-11-12 21:13 UTC

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