Skip to content

Add a compatibility shim for migrating Android build tools to Platforms#699

Open
freakboy3742 wants to merge 2 commits intopython:mainfrom
freakboy3742:android-compat
Open

Add a compatibility shim for migrating Android build tools to Platforms#699
freakboy3742 wants to merge 2 commits intopython:mainfrom
freakboy3742:android-compat

Conversation

@freakboy3742
Copy link
Copy Markdown
Contributor

Following the pattern used by the iOS build, adds a compatibility shim so that the buildbot will run Platforms/Android, but that location will work on 3.13 and 3.14 repos that store the Android build code in Android/android.py.

Also updates the iOS configuration to use the same general pattern for invoking the build script.

As part of this, the CACHE_DIR configuration has been moved out of the buildbot definition, and into the environment where the buildbot is executed. This means the buildbot configuration is no longer sensitive to the specific user account that is hosting the buildbot instance.

This configuration can be landed now, without the Platforms migration having been made - the Android folder exists in all 3.13+ repos as of right now. Once the Platforms migration occurs the symlink step will become a no-op.

@freakboy3742 freakboy3742 requested review from mhsmith and vstinner April 8, 2026 07:33
name="Set up compatibility symlink",
command=(
"[ -e Platforms/Android ]"
"|| ln -s ../Android Platforms/Android"
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.

On Python 3.13, this command fails with:

ln: failed to create symbolic link 'Platforms/Android': No such file or directory

You should create the Platforms/ directory somehow. For example, add [ -e Platforms ] || mkdir Platforms; prefix to your command.

Comment on lines +1277 to +1279
"[ -e Platforms/Android ]"
"|| ln -s ../Android Platforms/Android"
"&& ln -si ../Android/android.py Platforms/Android/__main__.py"
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.

For readability, you should add spaces:

Suggested change
"[ -e Platforms/Android ]"
"|| ln -s ../Android Platforms/Android"
"&& ln -si ../Android/android.py Platforms/Android/__main__.py"
"[ -e Platforms/Android ] "
"|| ln -s ../Android Platforms/Android "
"&& ln -si ../Android/android.py Platforms/Android/__main__.py"

android_py = ["python3", "Platforms/Android"]
self.addSteps([
# This symlink is needed to support pre Python 3.15 builds - it makes the
# top level Andrdoid folder appear in the new Platforms/Android location,
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.

Suggested change
# top level Andrdoid folder appear in the new Platforms/Android location,
# top level Android folder appear in the new Platforms/Android location,

Comment on lines +1277 to +1279
"[ -e Platforms/Android ]"
"|| ln -s ../Android Platforms/Android"
"&& ln -si ../Android/android.py Platforms/Android/__main__.py"
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.

This would be much more readable as an if ... then statement.

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