Skip to content

gh-146450: Ensure Android gradle build uses custom cross-build dir#148319

Open
freakboy3742 wants to merge 6 commits intopython:mainfrom
freakboy3742:android-cross-build-dir
Open

gh-146450: Ensure Android gradle build uses custom cross-build dir#148319
freakboy3742 wants to merge 6 commits intopython:mainfrom
freakboy3742:android-cross-build-dir

Conversation

@freakboy3742
Copy link
Copy Markdown
Contributor

#146450 introduced the ability to customise the cross-build directory (to aid with maintaining multiple Python version backports). The build script honors this setting, but doesn't guarantee that the gradle environment will also use the setting.

@freakboy3742
Copy link
Copy Markdown
Contributor Author

!buildbot android

@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 68ba1d7 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148319%2Fmerge

The command will test the builders whose names match following regular expression: android

The builders matched are:

  • AMD64 Android PR
  • aarch64 Android PR

# Ensure that CROSS_BUILD_DIR is in the Gradle environment, regardless
# of whether it was set by environment variable or `--cross-build-dir`.
env = os.environ.copy()
env["CROSS_BUILD_DIR"] = CROSS_BUILD_DIR
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.

I was going to say that we could avoid duplication by setting this environment variable in main. However, running the app outside of this script isn't actually useful in practice, so I suggest instead deleting the build-testbed command completely.

make_host,
build,
package,
build_testbed,
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.

main accesses context.cross_build_dir unconditionally even though not every command has this option. In pypa/cibuildwheel#2818 I worked around this using getattr, but in fact every command should have this option, because even env calls subdir in some situations. So I suggest moving the add_argument("--cross-build-dir") call to add_parser.

@freakboy3742
Copy link
Copy Markdown
Contributor Author

!buildbot android

@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 030c9bd 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148319%2Fmerge

The command will test the builders whose names match following regular expression: android

The builders matched are:

  • AMD64 Android PR
  • aarch64 Android PR

@freakboy3742 freakboy3742 requested a review from mhsmith April 11, 2026 07:48
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.

3 participants