Commit 547bc08
committed
Fix Windows-specific issues: line endings and file locking
Two key Windows compatibility fixes:
1. Normalize line endings: Windows Swift outputs \r\n but tests expect \n.
Added normalizeLineEndings() function to convert all output to Unix-style
line endings for cross-platform consistency.
2. Fix file locking errors: On Windows, atomically:true when writing files
can cause Win32Error code 32 (file in use). Now we skip atomic writes
on Windows by passing atomically:!isWindows to String.write().
This affects both:
- ExecutionContext.swift (executeViaInterpreter and executeViaCompilation)
- SourceLocationTests.swift (runSwiftScript helper)
These changes allow tests to pass on Windows while maintaining existing
behavior on Unix platforms.1 parent ce5ef5b commit 547bc08
File tree
2 files changed
+16
-5
lines changed- Sources/gyb-swift
- Tests/gyb-swiftTests
2 files changed
+16
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
| 159 | + | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
224 | | - | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| |||
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | 126 | | |
128 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
0 commit comments