cmake: Introduce WITH_PYTHON build option #31669

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:250116-python changing 2 files +8 −6
  1. hebasto commented at 9:29 am on January 16, 2025: member

    This was suggested in #31476 (comment):

    An alternative would be to require python to be disabled explicitly. Otherwise, it seems odd that every setting in cmake has a static default that can only be overridden explicitly, except for some, which are silently downgraded?

    This PR updates the build system to fail by default on systems where the minimum required Python version is unavailable. It introduces an option that allows users to explicitly disable the Python requirement.

    The last commit is temporary and should be reverted once the minimum required Python version becomes available in the CentOS image being used.

    Closes #31476.

  2. DrahtBot commented at 9:29 am on January 16, 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/31669.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept NACK fanquake

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31593 (ci: Bump centos stream 10 by maflcko)
    • #31522 (ci: Enable DEBUG=1 for one GCC-12+ build to catch 117966 regressions by maflcko)
    • #31421 (cmake: Improve compatibility with Python version managers by hebasto)
    • #31233 (cmake: Improve robustness and usability by hebasto)
    • #30997 (build: Switch to Qt 6 by hebasto)
    • #30975 (Add multiprocess binaries to release build (except Windows, OpenBSD) by Sjors)

    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. DrahtBot added the label Build system on Jan 16, 2025
  4. hebasto force-pushed on Jan 16, 2025
  5. hebasto force-pushed on Jan 16, 2025
  6. hebasto added this to the milestone 29.0 on Jan 16, 2025
  7. fanquake commented at 10:03 am on January 16, 2025: member

    Not sure. Why does this need another build option? Given that this is just for working around silent CMake warnings in the CI, couldn’t this just be fixed by using explicit *_TEST options that otherwise fail if Python is missing?

    It also doesn’t solve #31476 generically, because every time a similar case comes up, we’ll have to add even more code and/or options.

  8. maflcko commented at 1:25 pm on January 16, 2025: member
    Yeah, I suggested this for reasons other than the CI fix, because it could be useful outside the CI as well. But no strong opinion.
  9. DrahtBot added the label Needs rebase on Jan 17, 2025
  10. cmake: Introduce `WITH_PYTHON` build option
    By default, the build system generation will fail on systems where the
    minimum required Python version is unavailable. This option allows
    users to explicitly disable the Python requirement.
    b71cdc07ea
  11. ci: Disable Python in CentOS Stream 9
    The minimum required Python version is unavailable in CentOS Stream 9
    repositories.
    b42f709b7f
  12. hebasto force-pushed on Jan 17, 2025
  13. hebasto commented at 1:21 pm on January 17, 2025: member
    Rebased due to the conflict with the merged #31651.
  14. fanquake commented at 1:21 pm on January 17, 2025: member
    NACK - based on the reasoning above.
  15. hebasto commented at 1:25 pm on January 17, 2025: member

    NACK - based on the reasoning above.

    Not sure. Why does this need another build option? Given that this is just for working around silent CMake warnings in the CI, couldn’t this just be fixed by using explicit *_TEST options that otherwise fail if Python is missing?

    What “explicit *_TEST options” do you mean?

  16. fanquake commented at 1:35 pm on January 17, 2025: member

    What “explicit *_TEST” do you mean?

    (Introducing) An option that does anything test related, that also requires Python, but I don’t think this solution is better than #31665, because it forces builders to start opting out of things, and doesn’t solve #31476 generically, compared to #31665.

  17. DrahtBot removed the label Needs rebase on Jan 17, 2025
  18. fanquake removed this from the milestone 29.0 on Jan 20, 2025
  19. DrahtBot added the label Needs rebase on Jan 20, 2025
  20. DrahtBot commented at 4:29 pm on January 20, 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-01-21 03:12 UTC

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