-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
dump-autoload generating different autoload files when run under Docker #8808
Comments
You can try to repro this directly writing a php script which calls https://github.com/composer/composer/blob/1.10/src/Composer/Autoload/ClassMapGenerator.php#L62 and perhaps debugging that might help you figure out how to best report this to WSL? It definitely sounds like a WSL 2 bug more than a Composer one. |
Thank you for your answer. Unfortunately, I wasn't successful in tracking down the issue. I've since switched to using the Linux root system though (projects located under |
FWIW I'm seeing this same issue running PHP installed via HomeBrew on a Mac. The classmaps seem to be missing for second level dependencies when using |
@roborourke please create a new issue and include as many details as possible if you want us to help. There was no resolution here and adding a "me too" without additional info isn't going to move things forward. |
Maybe this will help: |
THANK YOU! |
I have no explanation for the following behavior. When running the same command under Docker, the generated classmap misses a few hundred mappings:
Both commands are run under WSL 2. Running the Docker command from a Windows PowerShell doesn't change the output. (Installing PHP and composer under Windows I have not tried - it normally is a mess.)
I specifically miss class mappings of files defined in
autoload.classmap
(Laravel project):In total there are 310 (+2 .gitignore) files in this three directories, which is less than the difference mentioned. The
vendor/composer/autoload_classmap.php
contains some of the classes in those directories though, just not all of them as I'd expect.The only difference
composer diagnose
gives, besides the fact that everything seems ok, is the PHP version: 7.3.14 under WSL2 vs. 7.4.5 under Docker.Has anyone ever noticed something similar? I appreciate any valuable hint.
Update: 2020-04-22 14:26
After some diggin', tryin' and swearin' I'm now at the point where I know it must be related to WSL 2. If I use the old Docker for Windows backend (Hyper-V VM), it works fine. Also within the WSL 2, if I copy my project from the
/c/foo/bar
path to an internal path like/home/marvin/foo/bar
and run the Docker container todump-autoload
, the results are fine as well. So it must be an issue with the combination of WSL 2 as Docker backend and the mounted Windows drive.Interestingly enough, when running
docker run --rm -v /c/foo/bar:/app -w /app --entrypoint /bin/bash composer
using the WSL 2 Docker backend, thescandir()
PHP function for example returns all the files for which I'm missing the mapping within the classmap. So the files are there and permissions are fine, they just don't seem to be handled correctly.The text was updated successfully, but these errors were encountered: