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
relative symlinks do not work on Windows #62
Comments
@discordier any reason we're not using AppVeyor to test on windows? |
Not really. Will set it up. |
@fritzmg could you provide a unit test? I just set up appveyor which should then point out the problem. |
I don't know, I have never created unit tests 😁 |
I just stumbled upon the same issue while trying to make an Contao 3.5 extension compatible with Contao 4 and I can confirm this. |
Unit test? Example information? Anything? These "mee too" comments lead us to nowhere, we need test data to reproduce a problem. In your comment you write that:
Please supply relevant information. Thanks. |
There is already a test for symlinks: https://github.com/contao-community-alliance/composer-plugin/blob/3.0.4/tests/ContaoModuleInstallerTest.php#L99-L130 |
@discordier do we have AppVeyor now? |
We should, however we have build issues as it seems, will bump the appveyor config from core-bundle and check if it works out. |
Appveyor is up and running and failing tests like a charm. yet the original issue stands, does the above linked test reproduce the issue by @fritzmg or do we need another unit test for this? |
Ok, I fixed several problems already. However, appveyor still breaks on 3 tests and I fail to see why. I fired up a Windows at a customer and ran the tests there. Only one failing there. @fritzmg You seem to have comprehensive experience with Windows debugging of the symlink issues, could you have a look on the remaining test cases and tell me why they might fail to create the links? Funny part is, during my testing the creation of the symlink went just fine, just the validation of a relative symlink failed due to Windows failing to execute the
|
Which PHP version is used for testing? |
5.6 and 7.0 so far. |
Hm, it's weird that the creation of the relative symlink works. It still has not been fixed in any PHP version, including PHP 7: php/php-src#1243 I have no experience with AppVeyor, how exactly are these tests run? Can I run these tests locally? |
I ran
locally and got
So the creation of the symlink fails as expected. |
Any updates on this? This makes developing a Contao 4 website currently rather inconvenient for me. I can make a PR for the absolute symlink fallback if you want. |
So the necessary changes is basically this? Do you get the IOException? |
I guess, I haven't yet looked at how it was actually implemented in Contao 4.
No, but the IOException comes from Symfony. The composer plugin does not use Symfony for symlinks, does it? |
Also Contao does not use a fallback on failure at all. It simply checks if the directory separator is
|
So both are failing for you? core-bundle and composer-plugin? |
No, core-bundle works, there was some other issue. But composer-plugin still gives me the initially described problem.
|
@discordier I saw you added a branch related to this, can this be finalized so we can release 3.0.5 ? |
We can surely try to finalize this, yet I lack the time to do this right now. Maybe I could try to squeeze it in next week. |
(I stumbled across this topic when trying to add codefog/haste (which requires the ComposerPlugin) to a contao 4.3 installation on a windows machine (PHP7) resulting in the same Failed to create symlink xyz error.) ...so just to sum it up:
Am I right to assume that the only working solution then is to use absolute links as a fallback? Sorry if this was clear all the time - I am just trying to understand the core of the problem and maybe help debugging/testing. 😉 EDIT: btw., thats how the actual paths look like:
|
Yes 😉 . Symfony does the same fallback. |
Right, I did a quick test and it seems to work without a problem so far! For my test, I just replaced this (https://github.com/contao-community-alliance/composer-plugin/blob/3.0.4/src/Installer/AbstractModuleInstaller.php#L240-L242):
with this:
|
@m-vo looks good, tested it as well. Can you please make a PR? |
@fritzmg Allright, I'll try my best (might take until mid next week, though). |
Since it's a simple fix, you could also just use the edit button here on GitHub ;) |
You're so right :-) First time I tried the online editor, hope it worked. |
Fixed in #67 |
When trying to install a Contao 3 extension in Contao 4 that is compatible with Contao 4, the composer-plugin tries to create a relative symlink from
/system/modules/…
to/vendor/…
» https://github.com/contao-community-alliance/composer-plugin/blob/3.0.4/src/Installer/AbstractModuleInstaller.php#L240However, this will fail on Windows. See contao/core-bundle#208 (comment).
The
contao/core-bundle
for example will fall back to absolute symlinks in such a case, and so does Symfony.The text was updated successfully, but these errors were encountered: