upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/cf_diff.py
diff options
context:
space:
mode:
authorEwann <207907827+dev-ewann@users.noreply.github.com>2026-11-22 14:17:59 +0000
committerEwann <207907827+dev-ewann@users.noreply.github.com>2026-11-22 14:20:30 +0000
commitec9b6cf22b27545b99fedc8583c0a392d835ece0 (patch)
tree1144bda93561eb5b7983554e7ea2f2c9da0ac221 /tools/cf_diff.py
parent003e78129303643a3fdc9e5f0e31a01b09759236 (diff)
tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/, make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention. AI-assisted (Claude), on behalf of dev-ewann.
Diffstat (limited to 'tools/cf_diff.py')
-rw-r--r--tools/cf_diff.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/cf_diff.py b/tools/cf_diff.py
index 741e21561..70d144753 100644
--- a/tools/cf_diff.py
+++ b/tools/cf_diff.py
@@ -567,7 +567,7 @@ def self_test():
567 e.items = [it for it in e.items if not (it[0] == "ins" and it[1].startswith("s_or_b32 exec_lo"))] 567 e.items = [it for it in e.items if not (it[0] == "ins" and it[1].startswith("s_or_b32 exec_lo"))]
568 with tempfile.TemporaryDirectory(prefix="cf-diff-") as tmp: 568 with tempfile.TemporaryDirectory(prefix="cf-diff-") as tmp:
569 p = os.path.join(tmp, "c.s") 569 p = os.path.join(tmp, "c.s")
570 with open(p, "w", encoding="utf-8") as f: 570 with open(p, "w", encoding="utf-8", newline="\n") as f:
571 f.write(listing_text(e.assemble(), "ps_canary_bad")) 571 f.write(listing_text(e.assemble(), "ps_canary_bad"))
572 if len(cf_ref.run(p, wave=32)["exports"]) != 4: # 4 > lane: lanes 0-3 stay on 572 if len(cf_ref.run(p, wave=32)["exports"]) != 4: # 4 > lane: lanes 0-3 stay on
573 print("canary FAILED: the reference did not drop lanes whose EXEC was never restored") 573 print("canary FAILED: the reference did not drop lanes whose EXEC was never restored")