Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Jan 16, 2025

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.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 16, 2025

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, purpleKarrot
Concept ACK janb84
Stale ACK maflcko

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:

  • #32697 (test: Turn util/test_runner into functional test by maflcko)

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.

@hebasto hebasto force-pushed the 250116-python branch 2 times, most recently from 751d491 to 796c36a Compare January 16, 2025 09:44
@hebasto hebasto added this to the 29.0 milestone Jan 16, 2025
@fanquake
Copy link
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.

@maflcko
Copy link
Member

maflcko commented Jan 16, 2025

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.

@hebasto
Copy link
Member Author

hebasto commented Jan 17, 2025

Rebased due to the conflict with the merged #31651.

@fanquake
Copy link
Member

NACK - based on the reasoning above.

@hebasto
Copy link
Member Author

hebasto commented Jan 17, 2025

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?

@fanquake
Copy link
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.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Seems fine to add an option to say "I don't have python and I don't care about the tests"

@hebasto hebasto closed this Feb 17, 2025
@maflcko
Copy link
Member

maflcko commented May 6, 2025

lgtm ACK 5155dbd

My nit about the warning isn't a blocker.

@hebasto hebasto reopened this May 8, 2025
@hebasto hebasto marked this pull request as draft May 8, 2025 16:01
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.
@hebasto hebasto marked this pull request as ready for review May 9, 2025 15:13
@hebasto
Copy link
Member Author

hebasto commented May 9, 2025

The feedback from @maflcko has been addressed.

Also rebased.

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned above, adding more build options/compexity, and forcing builders to opt out of things they don't care about, does not seem like a good, nor generic approach to fixing #31476. Especially given this is essentially a CI fix, to work around the fact that CMake doesn't have a way to turn warnings into errors?

@maflcko
Copy link
Member

maflcko commented May 9, 2025

forcing builders to opt out of things they don't care about

I am not sure the current approach of silently skipping tests (with just a warning during configure, not when running the tests) is the right approach.

A third alternative would be to delay the error to when they run the tests.

A fourth alternative would be to just call the two python tests from the functional test runner somehow and remove all this code here?

@hebasto
Copy link
Member Author

hebasto commented May 9, 2025

forcing builders to opt out of things they don't care about

I am not sure the current approach of silently skipping tests (with just a warning during configure, not when running the tests) is the right approach.

A third alternative would be to delay the error to when they run the tests.

FWIW, something similar has been implemented in #31233.

Copy link
Contributor

@janb84 janb84 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK 40d9359
(if we want to keep python check in CMAKE)

PR Adds build option to ignore / not fail on missing python. When python is missing or below required version the configuration will error out. This removes failing silently on python.
This PR will partial solve issue #31476 (strictly the Python issue)


Alternative thoughts:
Should CMAKE even test for python ? If you see CMAKE as configuration for the BUILD step and we do not use python in building should we even test for python ?

@purpleKarrot
Copy link
Contributor

NACK

I am with @fanquake here. The complexity increases exponentially with the number of build options.
Since the proposed build option does not actually affect build artifacts (like optional python bindings for some library would do), this does not really require a user facing setting. The approach in #31233 is much more elegant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants