Skip to content
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

bin-compat=auto behaves incorrectly on WSL #10094

Closed
skalpa-rld opened this issue Sep 9, 2021 · 1 comment
Closed

bin-compat=auto behaves incorrectly on WSL #10094

skalpa-rld opened this issue Sep 9, 2021 · 1 comment
Labels
Milestone

Comments

@skalpa-rld
Copy link

#9855 changed the behavior of bin-compat=auto on WSL while it shouldn't have. WSL is just a Linux virtual machine running on a Windows host, there is no reason why composer should behave differently on it than it does on any other Linux environment.

Worse, as the platform detection code is incorrect, .bat files are also added when running composer from a Docker container that runs on WSL (in that case, reading /proc/version from the container will still return a string that contains microsoft).

From what I saw, #9855 was merged to fix #9841, however #9841 should have been resolved as invalid.

As opposed to what the issue says, PHPStorm does not need .bat files to execute vendor binaries from WSL.

The reporter has a project in WSL, but is trying to run the vendor binaries using a PHP binary installed on the Windows host, which doesn't really make sense IMHO as the version of PHP installed on the host could be different than the one available in the Linux VM.

Thus I would suggest to reverse the behavior introduced by #9855 and treat WSL as any other Linux VM/environment by default. Users will still be able to set bin-compat=full if they really wish to use the vendor binaries from both the Linux and Windows side, but I believe it should not be the default behavior of bin-compat=auto.

If #9855 cannot be reversed, at least the platform detection code should be fixed so composer doesn't add .bat files to all the Linux Docker images built or executed on WSL.

@Seldaek
Copy link
Member

Seldaek commented Sep 13, 2021

We could say you can also set bin-compat: symlink if you're not interested in the auto compatibility mode. But anyway I'm not so interested in debating the value of the past decisions. I do agree docker containers running inside WSL shouldn't be seen as WSL in this context. I'll get a best-effort fix out for that.

@Seldaek Seldaek added this to the 2.1 milestone Sep 13, 2021
@Seldaek Seldaek added the Bug label Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants