From 20e43a2f3231fbcd9fef5383006ec33204a65e74 Mon Sep 17 00:00:00 2001 From: Andre Miras Date: Sun, 22 Feb 2026 10:30:30 +0000 Subject: [PATCH] :bug: 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. --- ci/rebuild_updated_recipes.py | 24 +++++++++++++++---- .../recipes/sdl3_mixer/__init__.py | 1 - 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ci/rebuild_updated_recipes.py b/ci/rebuild_updated_recipes.py index 26cba3bc7e..4161914b67 100755 --- a/ci/rebuild_updated_recipes.py +++ b/ci/rebuild_updated_recipes.py @@ -18,7 +18,6 @@ the list of recipes was huge and result was: [ERROR]: Didn't find any valid dependency graphs. [ERROR]: This means that some of your requirements pull in conflicting dependencies. -- only rebuilds on sdl2 bootstrap """ import sh import os @@ -57,14 +56,29 @@ def build(target_python, requirements, archs): android_sdk_home = os.environ['ANDROID_SDK_HOME'] android_ndk_home = os.environ['ANDROID_NDK_HOME'] requirements.add(target_python.name) - requirements = ','.join(requirements) - logger.info('requirements: {}'.format(requirements)) + requirements_str = ','.join(requirements) + logger.info('requirements: {}'.format(requirements_str)) + + # Detect bootstrap based on requirements + # SDL3 recipes conflict with SDL2, so we need the sdl3 bootstrap + # when any SDL3-related recipe (sdl3, sdl3_image, sdl3_mixer, sdl3_ttf) is present + bootstrap = None + if any(r.startswith('sdl3') for r in requirements): + bootstrap = 'sdl3' + logger.info('Detected sdl3 recipe in requirements, using sdl3 bootstrap') + build_command = [ 'setup.py', 'apk', '--sdk-dir', android_sdk_home, '--ndk-dir', android_ndk_home, - '--requirements', requirements - ] + [f"--arch={arch}" for arch in archs] + '--requirements', requirements_str + ] + + if bootstrap: + build_command.extend(['--bootstrap', bootstrap]) + + build_command.extend([f"--arch={arch}" for arch in archs]) + build_command_str = " ".join(build_command) logger.info(f"Build command: {build_command_str}") diff --git a/pythonforandroid/recipes/sdl3_mixer/__init__.py b/pythonforandroid/recipes/sdl3_mixer/__init__.py index c60c5bc157..56fb2c7518 100644 --- a/pythonforandroid/recipes/sdl3_mixer/__init__.py +++ b/pythonforandroid/recipes/sdl3_mixer/__init__.py @@ -7,7 +7,6 @@ class LibSDL3Mixer(BootstrapNDKRecipe): version = "72a73339731a12c1002f9caca64f1ab924938102" - # url = "https://github.com/libsdl-org/SDL_ttf/releases/download/release-{version}/SDL3_ttf-{version}.tar.gz" url = "https://github.com/libsdl-org/SDL_mixer/archive/{version}.tar.gz" dir_name = "SDL3_mixer"