Skip to content
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

Add a CMAKE option to completely disable Python #60463

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lbartoletti
Copy link
Member

Description

I'm opening this PR to discuss whether we should introduce an additional layer of restriction when disabling Python in QGIS. Is the WITH_BINDINGS flag sufficient to completely disable Python or should be enforced?

While WITH_BINDINGS disables PyQGIS support, if the goal is to entirely remove Python—especially for security reasons—is that enough? For example, I'm thinking about the pyplugin-installer, which is used with QGIS_DESTKTOP. Moreover, the CMakeLists file adds dependencies for pycore, pygui, and pyanalysis, yet I can't seem to locate them.

Is it necessary to include the src/python directory when WITH_BINDINGS is set to false?

Any thoughts?

@github-actions github-actions bot added this to the 3.42.0 milestone Feb 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 48bb09c)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 48bb09c)

@lbartoletti lbartoletti self-assigned this Feb 5, 2025
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
@nyalldawson
Copy link
Collaborator

I'm opening this PR to discuss whether we should introduce an additional layer of restriction when disabling Python in QGIS. Is the WITH_BINDINGS flag sufficient to completely disable Python or should be enforced?

I'm personally +1 to an opt-in "qgis with no python", I can definitely understand the rationale behind this. (The biggest impact of this is that the build will have NO processing support 🙀 )

@lbartoletti lbartoletti added the Squash! Remember to squash this PR, instead of merging or rebasing label Feb 6, 2025
@rouault
Copy link
Contributor

rouault commented Feb 6, 2025

The new option should be mentioned at https://github.com/qgis/QGIS/blob/master/INSTALL.md#371-available-compilation-flags

CMakeLists.txt Outdated Show resolved Hide resolved
INSTALL.md Outdated Show resolved Hide resolved
lbartoletti and others added 2 commits February 7, 2025 19:51
Co-authored-by: Even Rouault <[email protected]>
@nyalldawson
Copy link
Collaborator

@lbartoletti i think you force-pushed and dropped the fixes from my earlier comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Squash! Remember to squash this PR, instead of merging or rebasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants