utils.pwsh: Fix Windows config paths#309
Conversation
Apparently, CMake can fail when parsing the current path string because it interprets the backslash as the start of an escape sequence. Modern Windows can interpret paths with forward slashes, so it should be safe to change these slashes.
d426148 to
b58d62d
Compare
PatTheMav
left a comment
There was a problem hiding this comment.
I'm almost of the opinion that within PowerShell-scripts as well as CMake code we should default to POSIX path separators as that makes paths identical across all platforms and cannot accidentally introduce parsing issues due to escaping or be interpreted as a command line argument on Windows, etc.
|
Possibly out of scope, but I also noticed that if I ended up with several distributed path hierarchies starting with a root |
I agree, but that was a more sweeping change than I wanted to attempt at this time.
Yes, I would say that's out of scope for this PR. I think I have previously noticed this, but it has been some time. I think it depends on the order of your PATH entries. |
Description
Apparently, CMake can fail when parsing the current path string because it interprets the backslash as the start of an escape sequence. Modern Windows can interpret paths with forward slashes, so it should be safe to change these slashes.
Motivation and Context
Discovered this while attempting to update dependencies. Want to fix it separate from that update.
https://github.com/RytoEX/obs-deps/actions/runs/23963204885/job/69897580516#step:4:6211
How Has This Been Tested?
I haven't tested this change yet, but we use forward slashes in other paths for Windows elsewhere, so this is hopefully fine.
Types of changes
Checklist: