magento / magento/magento2-functional-testing-framework
Console command build:project starts subprocess with system-default PHP instead of the runtime PHP
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 154
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
Running the console command `build:project` with non-default PHP is not working as expected because the command runs sub-process `vendor/bin/codecept build` without specifying the PHP binary to run with, that in results makes the composer auto-loader utilize the default PHP binary from the system, which is not expected as we may have executed the `build:project` command with non system default PHP, eg:
```
php81 vendor/bin/mftf build:project
```
### Preconditions
No preconditions really, it's logical issues, but to see a practical problem you may use PHP 7.4 (or older) as default system PHP and install the MFTF with PHP 8.1 binary not aliased as `php` in the bash environment.
### Expected result
Successful build.
### Actual result
```
Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.29. in vendor/composer/platform_check.php on line 24
In BuildProjectCommand.php line 106:
The codecept build command failed unexpectedly. Please see the above output for more details.
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at BuildProjectCommand.php around line 106 and trace how the `vendor/bin/codecept build` subprocess is launched. Reproduce with PHP 8.1 while the system `php` is 7.4, then verify that `build:project` uses the invoking runtime and completes without the Composer platform error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100