ddev: ddev composer still doesn't quite do symlinks that result in proper behavior

Describe the bug

In v1.4.0 we introduced ddev composer, whose intent is to provide in-container predictable behavior, especially on Windows.

Inside the linux containers, creating a symlink appears to work (ln -s), and most linux commands respect it.

Sadly, php does not respect the “XSym” file that is created. So if you try to read a symlink with PHP, you’ll get the contents of the XSym file, not the contents of the target file.

To Reproduce

  • On Windows, in the container, on the mounted NTFS volume, create a file named README.md with the contents This is just a simple readme for testing purposes.
  • create a symlink to the README.md. For example, ln -s README.md mysymlink.md
  • Read the file with cat. It will work fine. cat mysymlink.md will result in the proper output (the content of README.md).
  • Read the file with PHP instead, using this script:
<?php

if ($fh = fopen('mysymlink.md', 'r')) {
    while (!feof($fh)) {
        $line = fgets($fh);
        echo $line;
    }
    fclose($fh);
}

Expected behavior

php should read the target file instead. Which is what it does if you create a proper symlink on the Windows host:

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for taking it for a spin! Hopefully it will work out for people. It’s possible that in the future we’ll want to make a command that does nothing but “repair” XSym links.