Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths - On Windows, normalize to forward-slash #368

Merged
merged 2 commits into from
Sep 26, 2024
Merged

Conversation

totten
Copy link
Owner

@totten totten commented Sep 25, 2024

As reported by loren-bm on (Mattermost), there's a recent regression when running civix upgrade on Windows:

Executing upgrade script phar://E:/d10/vendor/civicrm/cli-tools/extern/civix.phar/upgrades\24.09.0.up.php

In Checker.php line 55:

  [RuntimeException]
  Unrecognized library: civimix-schema@5

The underlying problem involves the switch to Webmozart\Glob -- @demeritcowboy found that it expects to have paths normalized using /. This is not entirely unusual. Symfony Filesystem v5.4+ has a similar normalization policy.

This revision should fix the error. The patch is a little more aggressive, in that it flip-flips on the whole approach to normalizing paths:

  • Before: Path helper tries to use native DIRECTORY_SEPARATOR. But it doesn't try very hard. So in practice, you probably a get a mix of delimiters.
  • After: Path helper tries to consistently use / on both Windows and Unix.

I've posted an example build of civix.phar at:

https://ephemera.civicrm.org/civix/civix.phar-2024-09-25-windows

@demeritcowboy
Copy link
Contributor

Thanks. This works for me. 👍

@totten totten merged commit 9879bbc into master Sep 26, 2024
1 check passed
@totten totten deleted the master-path-norm branch September 26, 2024 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants