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
Symlinked dir+file combo evades exclude-from-classmap #9773
Comments
When processing the classmap directories, we filter the When we process @Seldaek I think we only took into account that files might be symlinked, not directories. I could be mistaken though. |
Yeah I am not sure what is the exact cause.. This symlink setup seems like quite a mess and I don't know where it's failing but it's most likely the source of the problem. Does it work if you do |
When processing |
👍 These both work. Whether or not they fit his use-case is another question though. |
Many thanks for looking into this!
I do realize how convoluted this example appears after I simplified it, but I assure you this was a real use case 😄. I can elaborate a little bit just for context. This was a development-level working set up where I could swap out top-level dirs by just flipping symlinks. I have a specific top-level repo dir for each of my clients (e.g. I have since worked around this by no longer using these top-level directory symlinks, and just rename the directories when I need to swap clients, and that works fine. I will note that I use many file-symlinks to avoid duplication, and everything works together nicely - only when there is also a directory symlink in play do I have any issues.
This actually will work for my use case, as for my case I do happen to have unique filenames that I always want excluded from the classmap. However, I feel like the exclude-from-classmap should always exclude if I have put in the realpath of a file... but then again, I am probably the first person to encounter this and so I will of course, respectfully leave it to your discretion as to how to proceed. If there is any way I can be of assistance please let me know. |
Happy to mark this as a bug, but realistically this is quite the edge case situation so not likely someone will look at fixing this soon, especially as you have a working solution now. |
My
composer.json
:Output of
composer diagnose
:When I run this command:
I get the following output:
And I expected this to happen:
We should see "Generated optimized autoload files containing 1 class".
But really, there should NOT be
src/A.php
invendor/composer/autoload_classmap.php
, as it has been specifically excluded.Instead, I see the following in
vendor/composer/autoload_classmap.php
:The directory structure is as follows:
Which can be easily re-created with the following commands:
Basically, a symlink to a dir, which contains a symlink to a file within it.
The text was updated successfully, but these errors were encountered: