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

[PhpunitBridge] Can't set the composer binary #41774

Closed
Taluu opened this issue Jun 21, 2021 · 6 comments
Closed

[PhpunitBridge] Can't set the composer binary #41774

Taluu opened this issue Jun 21, 2021 · 6 comments

Comments

@Taluu
Copy link
Contributor

Taluu commented Jun 21, 2021

Symfony version(s) affected: Since 3.4.0 it seems ?

Description
If you have let's say composer 1 and composer 2 both installed with different binary paths, you before had the possibility to tell phpunit-bridge what executable it should use.

This is not the case anymore, so it will always fallback (or try to find) a composer binary... which can be 1.0, when there can be another binary such as composer2 available.

How to reproduce
Install both versions of composer, let's say composer and composer2. composer will always be used, even if you set the COMPOSER_BINARY variable as it should be.

Possible Solution
Reintroduce the COMPOSER_BINARY env var in the simple-phpunit bridge since 4.4.

@Taluu
Copy link
Contributor Author

Taluu commented Jun 21, 2021

Unless there was a specific reason on why this was removed ? @nicolas-grekas

@nicolas-grekas
Copy link
Member

When has it been removed? I'm don't remember anything like that (I don't remember it worked either btw.)

@Taluu
Copy link
Contributor Author

Taluu commented Jun 21, 2021

On 3.4, there was that : https://github.com/symfony/phpunit-bridge/blob/3.4/bin/simple-phpunit#L68-L74

And since at least 4.0 : https://github.com/symfony/phpunit-bridge/blob/4.0/bin/simple-phpunit#L50-L52

As you can see, the if is now gone, assuming it seems it must look for the composer binary itself.

(Yeah I'm kinda stuck on 3.4 for now 😢 )

@nicolas-grekas
Copy link
Member

Can you find the commit where it's been removed? That might help get the background of the change.

@stof
Copy link
Member

stof commented Jun 21, 2021

support for COMPOSER_BINARY was added in 3.4.40 in symfony/phpunit-bridge@0b83e8a (in #36566)
That's why it is not there in 4.0 (4.0 was already EOMed at that point).
As the code moved to a separate file in 4.3, this new feature was probably lost when merging up in the 4.4 branch.

@Taluu
Copy link
Contributor Author

Taluu commented Jun 21, 2021

Yep, I pinpointed 4.0 as it was gone from there. but yeah it seems it was added way afterwards and lost after a while.

Here is the commit : 6dce90d and the PR : #36566

nicolas-grekas added a commit that referenced this issue Jun 22, 2021
…hen using simple-phpunit (Taluu)

This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] fix handling the COMPOSER_BINARY env var when using simple-phpunit

| Q             | A
| ------------- | ---
| Branch?       | 4.4 and next
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #41774
| License       | MIT

Since the renaming of the simple phpunit file (from the shebang to the php file) in #31364, it looks like the change made from #36566 was lost as it seems to have been merged after.

So this PR is an attempt to "restore" that functionnality, as it was considered a bug fix on 3.4 at the time.

poke `@nicolas`-grekas

Commits
-------

9589b52 Reapply the change to allow to set the composer binary path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants