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 1 commit 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=65sFull 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! |
|
Hey @thewilsonator, just wanted to check in on this — no rush, I know you're busy! All Windows and Ubuntu checks are passing. Let me know if there's anything you'd like me to change |
|
Done, squashed and force pushed. Please take another look! |
|
My bad! Had the test in the wrong tests/ folder with a run.d. Fixed it — moved to test/issue3070/ with a proper test/issue3070.sh following the existing pattern. |
|
Squashed into a single commit. The CI failures are pre-existing on master (Testsuite #2948 also fails) — unrelated to this PR |
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.