Commit d792d1d
Make apply_patches.py tolerate CRLF/LF in patch context
On Windows runners (and local Windows clones), git checkout converts
text files to CRLF by default, but our patches in third_party/ were
generated with LF endings. The mismatch in context lines makes
git apply --check report "patch failed: X: patch does not apply"
even when the actual change is fine.
apply_patches.py was bailing on first conflict — meaning when the
Sanitizer/SanitizerAttributes/CMakeLists.txt hunk in
triton_shared.patch failed CRLF matching, the PtrAnalysis.cpp hunk
(which contains the size_t = ~0ULL fix that prevents an MSVC
narrowing-conversion error) never got applied either. The Windows
wheel build then died at compile time:
PtrAnalysis.cpp(980): error C2397: conversion from 'int' to 'size_t'
requires a narrowing conversion
Add --ignore-whitespace to all three git apply invocations
(check, reverse-check, real apply). git apply documents this flag
as making context-line matching tolerant of whitespace differences;
in practice CRLF vs LF falls under that tolerance. Linux and macOS
behavior is unchanged because their checkouts already match the
patch's LF endings.
Note: gitattributes can't fix this because they don't cross
submodule boundaries — the affected files live inside
third_party/triton_shared/, which is its own git repo with its own
attribute scope. A workflow-only fix (core.autocrlf=false) would
help CI but not local Windows developers; this fix helps both.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c65c2c9 commit d792d1d
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | | - | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
91 | | - | |
| 94 | + | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
| |||
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | | - | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| |||
0 commit comments