Skip to content

Commit 20e43a2

Browse files
committed
🐛 Fix sdl2/sdl3 bootstrap conflict in CI
Auto-detect sdl3 bootstrap when any SDL3-related recipe (sdl3, sdl3_image, sdl3_mixer, sdl3_ttf) is in requirements, preventing conflict with hardcoded sdl2 bootstrap in the test app's setup.py. Also remove stale commented-out URL from sdl3_mixer recipe that incorrectly referenced SDL_ttf.
1 parent 6e558e4 commit 20e43a2

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

ci/rebuild_updated_recipes.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
the list of recipes was huge and result was:
1919
[ERROR]: Didn't find any valid dependency graphs.
2020
[ERROR]: This means that some of your requirements pull in conflicting dependencies.
21-
- only rebuilds on sdl2 bootstrap
2221
"""
2322
import sh
2423
import os
@@ -57,14 +56,29 @@ def build(target_python, requirements, archs):
5756
android_sdk_home = os.environ['ANDROID_SDK_HOME']
5857
android_ndk_home = os.environ['ANDROID_NDK_HOME']
5958
requirements.add(target_python.name)
60-
requirements = ','.join(requirements)
61-
logger.info('requirements: {}'.format(requirements))
59+
requirements_str = ','.join(requirements)
60+
logger.info('requirements: {}'.format(requirements_str))
61+
62+
# Detect bootstrap based on requirements
63+
# SDL3 recipes conflict with SDL2, so we need the sdl3 bootstrap
64+
# when any SDL3-related recipe (sdl3, sdl3_image, sdl3_mixer, sdl3_ttf) is present
65+
bootstrap = None
66+
if any(r.startswith('sdl3') for r in requirements):
67+
bootstrap = 'sdl3'
68+
logger.info('Detected sdl3 recipe in requirements, using sdl3 bootstrap')
69+
6270
build_command = [
6371
'setup.py', 'apk',
6472
'--sdk-dir', android_sdk_home,
6573
'--ndk-dir', android_ndk_home,
66-
'--requirements', requirements
67-
] + [f"--arch={arch}" for arch in archs]
74+
'--requirements', requirements_str
75+
]
76+
77+
if bootstrap:
78+
build_command.extend(['--bootstrap', bootstrap])
79+
80+
build_command.extend([f"--arch={arch}" for arch in archs])
81+
6882
build_command_str = " ".join(build_command)
6983
logger.info(f"Build command: {build_command_str}")
7084

pythonforandroid/recipes/sdl3_mixer/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
class LibSDL3Mixer(BootstrapNDKRecipe):
99
version = "72a73339731a12c1002f9caca64f1ab924938102"
10-
# url = "https://github.com/libsdl-org/SDL_ttf/releases/download/release-{version}/SDL3_ttf-{version}.tar.gz"
1110
url = "https://github.com/libsdl-org/SDL_mixer/archive/{version}.tar.gz"
1211
dir_name = "SDL3_mixer"
1312

0 commit comments

Comments
 (0)