Add a compatibility shim for migrating Android build tools to Platforms#699
Add a compatibility shim for migrating Android build tools to Platforms#699freakboy3742 wants to merge 5 commits intopython:mainfrom
Conversation
master/custom/factories.py
Outdated
| name="Set up compatibility symlink", | ||
| command=( | ||
| "[ -e Platforms/Android ]" | ||
| "|| ln -s ../Android Platforms/Android" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
🤦 I forgot that 3.14 has the Platforms directory; but 3.13 doesn't. Fixed.
master/custom/factories.py
Outdated
| "[ -e Platforms/Android ]" | ||
| "|| ln -s ../Android Platforms/Android" | ||
| "&& ln -si ../Android/android.py Platforms/Android/__main__.py" |
There was a problem hiding this comment.
For readability, you should add spaces:
| "[ -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" |
master/custom/factories.py
Outdated
| "[ -e Platforms/Android ]" | ||
| "|| ln -s ../Android Platforms/Android" | ||
| "&& ln -si ../Android/android.py Platforms/Android/__main__.py" |
There was a problem hiding this comment.
This would be much more readable as an if ... then statement.
There was a problem hiding this comment.
It might be a little more readable in this file, but it won't be in the logged output (since I don't think we can preserve the newlines that would make it readable. Even then, I'm not sure a single line if (); then ; fi is much more readable on a single line, given how prevalent ||/&& syntax is in bash generally.
There was a problem hiding this comment.
I find it significantly more readable, especially when the expression contains both && and || and you have to try to remember which one is higher precedence.
There was a problem hiding this comment.
I've had a thought that let us combine the need to indent with the need for spaces for separators; thoughts?
master/custom/factories.py
Outdated
| "[ -e Platforms/Android ] " | ||
| "|| mkdir -p Platforms " | ||
| "&& ln -s ../Android Platforms/Android " | ||
| "&& ln -si ../Android/android.py Platforms/Android/__main__.py" |
There was a problem hiding this comment.
-i doesn't seem useful in this context.
There was a problem hiding this comment.
... I have no idea where that came from...
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 inAndroid/android.py.Also updates the iOS configuration to use the same general pattern for invoking the build script.
As part of this, the
CACHE_DIRconfiguration 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
Platformsmigration 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.