Skip to content

Conversation

Copy link

Copilot AI commented Oct 13, 2025

Overview

This PR adds a skip-debug flag feature to the Telegram/build/prepare/prepare.py script, mirroring the existing skip-release flag functionality. This allows users to skip all debug build procedures when building libraries, which can significantly reduce build time when only release binaries are needed.

Changes

Added support for the skip-debug command-line flag in prepare.py:

  1. Added 'skip-debug' to the optionsList (line 63)
  2. Added debug scope filtering logic in the filterByPlatform() function (lines 259-263)
  3. Added debug scope markers to 20 library stages with debug builds, including:
    • Used win_debug: and win_release: for Windows builds
    • Used mac_debug: and mac_release: for macOS builds
    • Used platform-specific scopes like win32_debug:, win64_debug:, winarm_debug: where needed

The implementation follows the exact same pattern as the existing skip-release flag for consistency.

Libraries Updated

All 20 library stages with debug builds now have proper debug scope markers:

  • lzma, zlib, mozjpeg, openssl3, opus, rnnoise, dav1d, openh264
  • libavif, libde265, libheif, libjxl, liblcms2
  • openal-soft, breakpad, crashpad, tg_angle, tg_owt
  • ada, protobuf, tde2e

How It Works

The prepare.py script uses scope markers to conditionally execute build commands:

  • debug: - Commands that run for debug builds
  • release: - Commands that run for release builds
  • win_debug:, mac_debug:, etc. - Platform-specific debug builds
  • win32_debug:, win64_debug:, winarm_debug: - Architecture-specific debug builds

When the skip-debug flag is provided, any build commands marked with a debug scope are filtered out and not executed.

Usage

# Build both debug and release configurations (default)
python prepare.py

# Skip debug builds (build only release)
python prepare.py skip-debug

# Skip release builds (build only debug)
python prepare.py skip-release

# Can be combined with other flags
python prepare.py skip-debug qt6

Example

Library stages now use debug scope markers:

stage('library', """
win:
    git clone https://github.com/example/library.git
    cd library
    cmake -A %WIN32X64% .
win_debug:
    cmake --build . --config Debug --parallel
win_release:
    cmake --build . --config Release --parallel
""")

When users run python prepare.py skip-debug, only the release build will execute, saving build time.

Benefits

  • Faster builds: Skip unnecessary debug builds when only release binaries are needed
  • Consistent API: Works exactly like the existing skip-release flag
  • Flexible: Supports combined scopes for platform-specific debug builds
  • Non-breaking: No changes to existing functionality or build behavior
  • Ready to use: All library stages are already configured with debug scope markers

Testing

  • ✓ Python syntax validation passed
  • ✓ Implementation pattern verified to match skip-release
  • ✓ Functional tests confirm correct filtering behavior
  • ✓ All 20 library stages verified to have both debug and release scope markers
  • ✓ No breaking changes to existing builds
Original prompt

Check the file Telegram/build/prepare/prepare.py, and add a "skip-debug" flag feature to the python script. If the flag applied, all the debug build procedures of the libraries should be skiped.

Currently, the script already has a "skip-release" parameter, you should check how the flag works and refer it to implement the "skip-debug" flag feature.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits October 13, 2025 03:48
Co-authored-by: Revincx <25524750+Revincx@users.noreply.github.com>
Co-authored-by: Revincx <25524750+Revincx@users.noreply.github.com>
Co-authored-by: Revincx <25524750+Revincx@users.noreply.github.com>
Co-authored-by: Revincx <25524750+Revincx@users.noreply.github.com>
Copilot AI changed the title [WIP] Add skip-debug flag feature to prepare.py Add skip-debug flag to prepare.py build script Oct 13, 2025
Copilot AI requested a review from Revincx October 13, 2025 03:54
@Revincx
Copy link
Owner

Revincx commented Oct 13, 2025

@copilot Please help me add debug scope markers to the debug-specific build commands.

For example:

debug:
    cmake --build . --config Debug --parallel

You should check all stages of all libraries and determine where the scope marker should be added.

Note: the scope markers can be combined and take effects at the same time, such as win_release combines win and release marker. You can use this feature to add debug scope markers to the build commands more flexibly.

Co-authored-by: Revincx <25524750+Revincx@users.noreply.github.com>
Copy link
Author

Copilot AI commented Oct 13, 2025

@copilot Please help me add debug scope markers to the debug-specific build commands.

For example:
...

I've added debug scope markers to all library debug-specific build commands. The changes include:

20 library stages updated with debug scope markers:

  • Used win_debug:/win_release: for Windows builds
  • Used mac_debug:/mac_release: for macOS builds
  • Used combined scopes like win32_debug:, win64_debug:, winarm_debug: for platform-specific builds (e.g., in openssl3)

All stages with debug builds now have proper scope markers, so the skip-debug flag will work correctly to skip debug builds.

Commit: This change is in the latest commit.

Co-authored-by: Revincx <25524750+Revincx@users.noreply.github.com>
@Revincx Revincx marked this pull request as ready for review October 13, 2025 04:13
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.

2 participants