This is an archive of the discontinued LLVM Phabricator instance.

[lit] [windows] Make sure to convert all path separators to backslashes in NT style \\?\... paths
ClosedPublic

Authored by mstorsjo on Dec 13 2019, 1:37 PM.

Details

Summary

E.g. the mingw python distributed in msys2 (the mingw one, which is a normal win32 application and doesn't use the msys2 runtime itself), despite being a normal win32 python, still uses forward slashes. This works fine for other cases, but when constructing a raw NT path, all path separators must be backslashes.

Diff Detail

Event Timeline

mstorsjo created this revision.Dec 13 2019, 1:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2019, 1:37 PM
Herald added a subscriber: delcypher. · View Herald Transcript

Admittedly, this python doesn't really pass all tests anyway, as some tests rely on path formatting to match between different components - but it does help running some number of tests with it at least.

rnk accepted this revision.Dec 13 2019, 1:52 PM

lgtm

llvm/utils/lit/lit/util.py
157

I feel like path.replace('/', '\\') would be the more obvious spelling (fewer temporary strings), but they are functionally equivalent.

This revision is now accepted and ready to land.Dec 13 2019, 1:52 PM
mstorsjo marked an inline comment as done.Dec 13 2019, 3:20 PM
mstorsjo added inline comments.
llvm/utils/lit/lit/util.py
157

Ah, yes, will change it to that form before pushing the change. Thanks!

This revision was automatically updated to reflect the committed changes.