-
Notifications
You must be signed in to change notification settings - Fork 25
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
Invalid relative path used on Windows #94
Comments
Yeah, I'm aware it doesn't work on Windows, see #30 for possible cause/solution. Unfortunately I don't have or use a Windows computer myself, so the motivation to resolve this has been low. (i.e. I fix easier to fix problems first!) I did add Windows to the GitHub Actions CI text matrix recently: 457b53c, so I do intend to address this, and your issue might help quite a bit. It looks like something is going wrong here:
|
That should work now. Please test |
@BrianHenryIE Thaks for the quick action. Unfortunately, it still does not work, now with the following error: Unable to read file from location: vendor/src/I:/strauss-example/vendor/brianhenryie/strauss/src/Autoload.php. file_get_contents(I:\strauss-example\vendor/src/I:/strauss-example/vendor/brianhenryie/strauss/src/Autoload.php): Failed to open stream: No such file or directory I've updated the Strauss version to |
Strauss creates invalid "relative" file paths on Windows, which are actually absolute. It causes an error:
Unable to read file from location: (...)
, because it prepends the so called relative path with an absolute project path, creating paths which contain the absolute project base path twice.Steps to reproduce
composer install
composer prefix-namespaces
The solution
Here there is a line, which creates "relative" source file path using
$vendorDir
, which is an absolute path (at least on Windows - IDK how it behaves in other environments). Instead the$workingDir
could be subtracted from the$sourceAbsolutePath
to create a relative path (which actually works):The text was updated successfully, but these errors were encountered: