Fix duplicate source files on Windows due to mixed path separators (#3070)#3114
Fix duplicate source files on Windows due to mixed path separators (#3070)#3114hariprakazz wants to merge 2 commits intodlang:masterfrom
Conversation
|
✅ PR OK, no changes in deprecations or warnings Total deprecations: 0 Total warnings: 0 Build statistics: statistics (-before, +after)
executable size=5710288 bin/dub
-rough build time=70s
+rough build time=69sFull build output |
|
All Windows CI runs passed. The two Alpine failures appear to be pre-existing |
thewilsonator
left a comment
There was a problem hiding this comment.
Needs a test case for the suite, otherwise looks fine.
|
Thanks for the review! I'll add a test case. The extra diff is from a previous |
|
Force push, and squash unless there is a reason for those extra commits |
|
Force pushed a single clean commit rebased on current master. I’ll add a test case next. |
|
All CI checks are passing on Windows, Ubuntu, and macOS. The Alpine and macOS-13 failures are pre-existing infrastructure issues - same ones that failed before my changes. Ready for review! |
On Windows, when mainSourceFile is set with forward slashes (e.g. "src/foo.d")
but the same file gets collected from sourcePaths with backslashes ("src\foo.d"),
they end up as two separate entries — causing a duplicate main source file error.
This fix normalizes all source file paths using buildNormalizedPath before
deduplication, so mixed separators are treated as the same file.