devtools-lib icon indicating copy to clipboard operation
devtools-lib copied to clipboard

Fatal error while using composer 2.2.5

Open mallardduck opened this issue 3 years ago • 4 comments

The error is as follows:

Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::isTtySupported() in /Users/danpock/GitProjects/kickflip-src/vendor/ramsey/devtools-lib/src/Composer/Command/ProcessCommand.php:68

Seems to be from: https://github.com/ramsey/devtools-lib/blob/ea4205cc4fb3b68126977deff59742ede8105c90/src/Composer/Command/ProcessCommand.php#L68

mallardduck avatar Feb 01 '22 20:02 mallardduck

Thanks! I know what's causing it, and I'm working on a solution.

It's because the version of symfony/console that Composer uses internally is not the same version that the project uses.

Related:

  • https://github.com/ramsey/composer-repl/issues/3
  • https://github.com/ramsey/composer-plugin-issue/issues/1
  • https://github.com/composer/composer/issues/8907

ramsey avatar Feb 01 '22 20:02 ramsey

hmm. just trying to consider why it only broke my CI stuff recently. ultimately just wondering if there's an easy mitigation to it. 🤔

mallardduck avatar Feb 01 '22 20:02 mallardduck

Probably because I released 1.4.0 recently, which has this bug in it, and your CI environment grabbed the latest version. The quickest way to mitigate it (which is what I've had to do) is to use (or add) the following in your composer.json:

"ramsey/devtools-lib": "1.3.0"

This will lock your project to use 1.3.0, which works.

I'll try to have this fix later this week.

ramsey avatar Feb 01 '22 20:02 ramsey

Composer prior 2.3 uses symfony/console 3.4. The isTtySupported() method is really simple. Why do not copy&paste it to the devtool? It would be fast fix.

upyx avatar Apr 07 '22 05:04 upyx

I've just released a version 2.0 that should fix this issue (by raising the minimum supported versions).

ramsey avatar Apr 24 '23 23:04 ramsey