Skip to content

utils.pwsh: Fix Windows config paths#309

Merged
RytoEX merged 1 commit intoobsproject:masterfrom
RytoEX:fix-windows-config-paths
Apr 20, 2026
Merged

utils.pwsh: Fix Windows config paths#309
RytoEX merged 1 commit intoobsproject:masterfrom
RytoEX:fix-windows-config-paths

Conversation

@RytoEX
Copy link
Copy Markdown
Member

@RytoEX RytoEX commented Apr 6, 2026

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

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@RytoEX RytoEX requested a review from PatTheMav April 6, 2026 19:36
@RytoEX RytoEX self-assigned this Apr 6, 2026
@RytoEX RytoEX added bug Something isn't working Seeking Testers labels Apr 6, 2026
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.
@RytoEX RytoEX force-pushed the fix-windows-config-paths branch from d426148 to b58d62d Compare April 7, 2026 18:44
Copy link
Copy Markdown
Member

@PatTheMav PatTheMav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@PatTheMav
Copy link
Copy Markdown
Member

Possibly out of scope, but I also noticed that if git is installed within the msys2 environment but also "Git for Windows" is installed, that any invocation of git might hit the former, but not the latter, and provided path strings are misinterpreted.

I ended up with several distributed path hierarchies starting with a root c directory on my dev machine, depending from which directory I invoked the obs-deps build script.

@RytoEX
Copy link
Copy Markdown
Member Author

RytoEX commented Apr 20, 2026

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.

I agree, but that was a more sweeping change than I wanted to attempt at this time.

Possibly out of scope, but I also noticed that if git is installed within the msys2 environment but also "Git for Windows" is installed, that any invocation of git might hit the former, but not the latter, and provided path strings are misinterpreted.

I ended up with several distributed path hierarchies starting with a root c directory on my dev machine, depending from which directory I invoked the obs-deps build script.

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.

@RytoEX RytoEX merged commit 099e8c1 into obsproject:master Apr 20, 2026
22 checks passed
@RytoEX RytoEX deleted the fix-windows-config-paths branch April 20, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Seeking Testers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants