Unreleased

Not yet released

Fixed

  • viv diagnose no longer waits without a limit on the php, git and composer it runs for its version lines. 0.23.0 killed a hung php in the platform probe but left viv diagnose blocked on php -r for as long as the php ran. It now applies VIV_PHP_PROBE_TIMEOUT (30 seconds by default, 0 for no limit) to each of the three, kills the one that runs past it and prints php: did not answer within 30s (VIV_PHP_PROBE_TIMEOUT) before carrying on with the remaining lines. Composer is a PHP script, so its line can time out for the same reason. A value that is not a whole number of seconds is printed on those lines instead of stopping the report. In a project with a composer.lock, an error from the platform probe, such as a php that does not answer, is printed on a platform: line and the report carries on with the plugin lines instead of ending with that error (#368)
  • viv update 'vendor/*' treats the * in a package argument as a wildcard, as Composer does, and --minimal-changes leaves the packages it matches unpinned. viv used to read * as part of a name, so the argument matched no locked package, the update changed nothing, and a dist.shasum declared by a package repository stayed out of composer.lock. A following viv install therefore had no shasum to check the download against. viv update --lock still keeps the locked entries, as Composer does (#399)
  • viv add --no-normalize and viv rm --no-normalize (and the require and remove aliases) change only the require or require-dev entries they touch and leave every other byte of composer.json as it was, as composer require and composer remove do. From 0.8 to 0.23 the flag did nothing and printed --no-normalize is a no-op on add since 0.8, so viv rm always reordered the sections and expanded the inline arrays of the whole file. Without the flag both commands still normalize composer.json. The edited require or require-dev section can change its own layout, as it does in Composer. --sort-packages and config.sort-packages apply to the edit again, and the flag cannot be combined with viv add --repository, which edits repositories. A failed viv add or viv rm still writes the original bytes back (#400)
  • viv update, viv install, viv add, viv rm and viv new install the PHP build that extra.viv.php names when it is not downloaded yet, and read the platform's extensions from it. 0.23.0 read that build only when it was already in the cache, so with no php on PATH a first viv update <package> assumed PHP 8.3.0 with no extensions and refused every ext-* requirement, although viv run installs the same build on first use. The commands now print installing php 8.4.x (os-arch)… on stderr as viv run does, and a download that fails stops the command with an error that names the version, instead of checking against the php on PATH. With --offline they still read the php on PATH. viv diagnose and viv lock merge never download a build (#392)