Skip to content

Add new p4a opts - #2010

Open
T-Dynamos wants to merge 4 commits into
kivy:masterfrom
T-Dynamos:new_opts
Open

Add new p4a opts#2010
T-Dynamos wants to merge 4 commits into
kivy:masterfrom
T-Dynamos:new_opts

Conversation

@T-Dynamos

Copy link
Copy Markdown
Member

@kuzeyron kuzeyron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just one suggestion.

self.extra_p4a_args.append("--debug")

save_wheel_dir = self.buildozer.config.getdefault('app', "p4a.save_wheel_dir", "")
if save_wheel_dir != "":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

!= "" is not needed. Just use if save_wheel_dir:

Comment thread buildozer/default.spec Outdated
# These indexes are searched in addition to the default PyPI index during Android builds.
# WARNING: Third party indexes are untrusted sources and may introduce supply chain risks,
# including malicious, tampered, outdated, or incompatible packages.
extra_index_urls = https://chaquo.com/pypi-13.1/, https://anshdadwal.is-a.dev/p4a-wheels/p4a/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these trusted?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's not my decision, I think it should be empty by default - until kivy hosts it's own.
The index that I am hosting isn't granted to be stable (or secure?). It currently hosts every PyProjectRecipe and makes builds faster for me.

@T-Dynamos
T-Dynamos marked this pull request as ready for review May 15, 2026 19:23
@T-Dynamos
T-Dynamos requested a review from AndreMiras May 16, 2026 06:15
Comment thread buildozer/default.spec

# (bool) Disable use of prebuilt binary packages when available (currently Android only)
# If enabled, all dependencies are built from source even if prebuilt wheels exist.
skip_prebuilt = False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't we have the default match the current buildozer behavior which is to build from source and not use prebuilt binaries?
And actually I have the same question for the (now merged) p4a pull request (kivy/python-for-android#3280)

Comment thread buildozer/default.spec
# These indexes are searched in addition to the default PyPI index during Android builds.
# WARNING: Third party indexes are untrusted sources and may introduce supply chain risks,
# including malicious, tampered, outdated, or incompatible packages.
extra_index_urls = https://chaquo.com/pypi-13.1/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't we miss the p4a.* namespace here and in the other options?
So p4a.extra_index_urls here for instance

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was done keeping in mind that this option in future will also be implemented for iOS.

Comment thread buildozer/default.spec
# These indexes are searched in addition to the default PyPI index during Android builds.
# WARNING: Third party indexes are untrusted sources and may introduce supply chain risks,
# including malicious, tampered, outdated, or incompatible packages.
extra_index_urls = https://chaquo.com/pypi-13.1/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also agree with @kuzeyron that maybe we shouldn't enable/ship an "untrusted" thirdparty index by default. Maybe keeping it commented out would be good enough

self.extra_p4a_args.append(f"--extra-index-url={index}")

use_prebuilt_version_for = self.buildozer.config.getlist('app', "use_prebuilt_version_for", "")
for _recipes in use_prebuilt_version_for:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I'm not sure we need the leading underscore, I would drop it

if save_wheel_dir != "":
self.extra_p4a_args.append(f"--save-wheel-dir={save_wheel_dir}")

extra_index_urls = self.buildozer.config.getlist('app', "extra_index_urls", "")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why don't we default to [] for both getlist() calls?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants