mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1588] stale_build: strip comments/raw strings, handle UTF-8 BOM and backslashes, compare mtime_ns (STALE-BUILD-COMMENTS-BOM-AND-NS-MTIME) #1605
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1605
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1588
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/stale-build-comments-bom-and-ns-mtime📝 Commits (1)
db28a01stale_build: strip comments/raw strings, handle UTF-8 BOM and backslashes, compare mtime_ns📊 Changes
2 files changed (+86 additions, -9 deletions)
View changed files
📝
tests/test_stale_build.py(+50 -0)📝
tools/stale_build.py(+36 -9)📄 Description
Item:
STALE-BUILD-COMMENTS-BOM-AND-NS-MTIME(unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touchtools/stale_build.py).Summary
/* ... */), line comments (// ...), and raw string literals (R"(...)") before scanning for#include "..."so block-commented or raw-string includes are not followed, while/* note */ #include "real.h"and includes after strings containing"/*"are followed accurately.encoding="utf-8-sig"so a UTF-8 BOM (\ufeff) at the start of an MSVC-saved.cpp/.hdoes not cause the first-line#includeto be missed.#include "sub\nested.h") in_resolve_include()so Windows-style relative includes resolve on POSIX, and ignore absolute#includepaths instead of discarding the search directory viaos.path.join.os.stat(...).st_mtime_nsintegers innewer_sources()instead of float64os.path.getmtime()(which has ~238 ns ULP at modern Unix timestamps and misses 100 ns edits on NTFS/APFS/ext4), deduplicate via realpath/normcase, and sort returned relative paths deterministically.Verification
python3 -W error -I tests/test_stale_build.py -v: 19/19 passed.python3 -W error -I tests/test_stale_build_include_dirs.py -v: 11/11 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed.python3 -I scripts/check_no_game_data.py tools/stale_build.py tests/test_stale_build.py: passed.python3 -m compileall -q tools/stale_build.py tests/test_stale_build.py: passed.tests/test_stale_build.pyagainst unpatchedmain:tools/stale_build.py):failures=4, errors=0across all 4 new regression tests.AI-assisted: yes
GPUs tested: none (CPU-only Python build helper; synthetic source trees only, no game data)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.