From 42b92d7a2b384c687443633d4e5124fef96eb965 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Sun, 29 Nov 2026 08:00:47 -0800 Subject: [PATCH] release_artifact_lint: allow .debug_gdb_scripts (not DWARF, kept by strip --strip-debug) Part of #296; see forge-ci/ci.yml#574. Dry-run release 46280533130 failed artifact-preflight on rustc's gdb pretty-printer section. Ci-Attestation: {"at":1795968055,"gate":"general/linux-x64/lint","host":"linux-x86_64","key":"86949dafa1fea6b992f2ddfc4913bbac12f0052c24901869ec708edbb211f6cf","lane":"lint","parents":["e053b912b15e6b23e0df15a45b6481fe8f48914d"],"secs":4,"stamp":"8fd2959c3b2de1eb49b6383f34b5fc49","tree":"9ab56d0964bd7d00059e32f18275539455d15d12","v":1,"via":"run"} Ci-Attestation: {"at":1795968154,"gate":"python/linux-x64/test","host":"linux-x86_64","key":"6f946847ab70cd6bef29b13cac070c90f316e72e6f244432010aa4348ce5d851","lane":"test","parents":["e053b912b15e6b23e0df15a45b6481fe8f48914d"],"secs":98,"stamp":"d63465a25031a7f9170e5cb42946932d","tree":"9ab56d0964bd7d00059e32f18275539455d15d12","v":1,"via":"run"} Ci-Attestation: {"at":1795968055,"gate":"rust/all/fmt","host":"linux-x86_64","key":"86949dafa1fea6b992f2ddfc4913bbac12f0052c24901869ec708edbb211f6cf","lane":"lint","parents":["e053b912b15e6b23e0df15a45b6481fe8f48914d"],"secs":4,"stamp":"4f3d4f9c7a2e10550d120d4c3aac2837","tree":"9ab56d0964bd7d00059e32f18275539455d15d12","v":1,"via":"run"} Ci-Attestation: {"at":1795968055,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"86949dafa1fea6b992f2ddfc4913bbac12f0052c24901869ec708edbb211f6cf","lane":"lint","parents":["e053b912b15e6b23e0df15a45b6481fe8f48914d"],"secs":4,"stamp":"843267d9c5dcdde561d560b0159dc50a","tree":"9ab56d0964bd7d00059e32f18275539455d15d12","v":1,"via":"run"} Ci-Attestation: {"at":1795968055,"gate":"rust/x86_64-unknown-linux-gnu/dylint","host":"linux-x86_64","key":"86949dafa1fea6b992f2ddfc4913bbac12f0052c24901869ec708edbb211f6cf","lane":"lint","parents":["e053b912b15e6b23e0df15a45b6481fe8f48914d"],"secs":4,"stamp":"79b445994d4a30c566371b33d47dc32a","tree":"9ab56d0964bd7d00059e32f18275539455d15d12","v":1,"via":"run"} Ci-Attestation: {"at":1795968154,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"6f946847ab70cd6bef29b13cac070c90f316e72e6f244432010aa4348ce5d851","lane":"test","parents":["e053b912b15e6b23e0df15a45b6481fe8f48914d"],"secs":98,"stamp":"6c52a312e6208b23ea21d8f8a180368a","tree":"9ab56d0964bd7d00059e32f18275539455d15d12","v":1,"via":"run"} --- ci/release_artifact_lint.py | 8 +++++++- tests/unit/test_ci_modes.py | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ci/release_artifact_lint.py b/ci/release_artifact_lint.py index ddd998e9..e5a9714a 100644 --- a/ci/release_artifact_lint.py +++ b/ci/release_artifact_lint.py @@ -20,6 +20,9 @@ # REL-009 owner rule (#296): debug symbols ship only as GitHub release # sidecars, never inside a wheel. SYMBOL_SUFFIXES = (".pdb", ".debug", ".dwp", ".dwo", "-symbols.tar.zst") +# rustc's gdb pretty-printer loader: not DWARF, and `strip --strip-debug` +# deliberately keeps it (forge-ci/ci.yml#574). +NON_DWARF_DEBUG_SECTIONS = frozenset({".debug_gdb_scripts"}) def _elf_debug_sections(data: bytes) -> list[str]: @@ -45,7 +48,10 @@ def header(index: int) -> bytes: for index in range(shnum): name_off = int.from_bytes(header(index)[0:4], "little") name = names[name_off:].split(b"\0", 1)[0].decode("latin-1") - if name.startswith((".debug_", ".zdebug_")): + if ( + name.startswith((".debug_", ".zdebug_")) + and name not in NON_DWARF_DEBUG_SECTIONS + ): found.append(name) return found diff --git a/tests/unit/test_ci_modes.py b/tests/unit/test_ci_modes.py index a2557ea9..ed9a8f8f 100644 --- a/tests/unit/test_ci_modes.py +++ b/tests/unit/test_ci_modes.py @@ -607,3 +607,21 @@ def log_message(self, format, *args): assert verify.download(f"http://127.0.0.1:{port}/zip") == b"zipbytes" finally: server.shutdown() + + +def test_release_artifact_lint_allows_debug_gdb_scripts_only(): + """`strip --strip-debug` keeps rustc's .debug_gdb_scripts (not DWARF), forge-ci/ci.yml#574.""" + kept = _elf64([".text", ".debug_gdb_scripts", ".gnu_debuglink"]) + assert artifacts.wheel_symbol_problems({"fastled/bin/fastled": kept}) == [] + for dwarf in ( + ".debug_info", + ".debug_line", + ".debug_abbrev", + ".debug_str", + ".debug_ranges", + ".zdebug_info", + ): + image = _elf64([".text", ".debug_gdb_scripts", dwarf]) + problems = artifacts.wheel_symbol_problems({"fastled/bin/fastled": image}) + assert problems and dwarf in problems[0], dwarf + assert ".debug_gdb_scripts" not in problems[0], dwarf