- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
ComposerExecutableValidator
no longer exists.AFAICT this is still necessary in all places that interact with
ProcessFactory
, which in our case is everything usingComposerRunnerInterface
.Which at this point is only
\Drupal\package_manager\ComposerInspector
. - Issue was unassigned.
- Status changed to Needs work
over 1 year ago 2:18pm 9 May 2023 - Assigned to yash.rode
- last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 11:55am 11 May 2023 - ๐ฎ๐ณIndia yash.rode pune
I am not sure where it will throw process error in
\Drupal\package_manager\ComposerInspector
- Assigned to yash.rode
- Status changed to Needs work
over 1 year ago 1:03pm 11 May 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
What happened to the nice & simple MR?!? 310 changes now! ๐คช
Clearly the pre-existing MR is for
8.x-2.x
. You should have created a new one for3.0.x
rather than futzing with the existing MR.There is now literally more work than there was a few hours ago, because the correct example for
8.x-2.x
has now been destroyed, GitLab does not allow me to recover it AFAICT, since it does not show the commit prior to your force push. ๐ขIf I remember correctly off the top of my headโฆ then it's basically any invocation of
\PhpTuf\ComposerStager\Domain\Service\ProcessRunner\ComposerRunnerInterface::run()
, because that's what's interacts with SymfonyProcess
. - ๐ฎ๐ณIndia yash.rode pune
It was something like:
try { runner->run('--version') } catch (LogicException $e) { $event->addError([ $e->getMessage(), ]); }
- Assigned to wim leers
- Status changed to Needs review
over 1 year ago 1:28pm 11 May 2023 - ๐ฎ๐ณIndia yash.rode pune
Do we want to surround first occurrences of
\PhpTuf\ComposerStager\Domain\Service\ProcessRunner\ComposerRunnerInterface::run()
in try catch or all of them, or the error can happen at any time? - Assigned to yash.rode
- Status changed to Needs work
over 1 year ago 5:17pm 11 May 2023 - last update
over 1 year ago 788 pass - @yashrode opened merge request.
- ๐ฎ๐ณIndia yash.rode pune
Discussed this with @tedbow and @phenaproxima and decided that we don't want to do any logical changes here but just mention in out hook_help that the user need to enable proc_open.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I was following @TravisCarden's direction from 8 months ago in #3 a little bit too literally it seems ๐
I agree with @tedbow & @phenaproxima that we should not be catching this exception all over the place if it can only occur if
proc_open()
is disabled on a particular PHP install. But I don't see that in\PhpTuf\ComposerStager\Infrastructure\Factory\Process\ProcessFactory::create()
:final class ProcessFactory implements ProcessFactoryInterface { public function create(array $command): Process { try { return new Process($command); } catch (ExceptionInterface $e) { // @codeCoverageIgnore throw new LogicException($e->getMessage(), 0, $e); // @codeCoverageIgnore } } }
Ah, but
\Symfony\Component\Process\Process::__construct()
has this:/** * @param array $command The command to run and its arguments listed as separate entries * @param string|null $cwd The working directory or null to use the working dir of the current PHP process * @param array|null $env The environment variables or null to use the same environment as the current PHP process * @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input * @param int|float|null $timeout The timeout in seconds or null to disable * * @throws LogicException When proc_open is not installed */ public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60) { โฆ }
So basically,
\PhpTuf\ComposerStager\Infrastructure\Factory\Process\ProcessFactory::create()
is catching far too broadly and then re-throwing specifically. I don't get why but โฆ that's out of scope here.Conclusion:
- Not catching
LogicException
everywhereComposerRunnerInterface
is used is fine ๐ hook_help()
entry is fine ๐- But this is not enough. If
proc_open()
is disabled, there's literally nothing Package Manager can do. This should hence be a base requirement validator. Actually, arguably, this is an even more fundamental requirement thanComposerValidator
, because without this we literally cannot callcomposer
at all! ๐ณ๐ซThat means that our existing base requirement
\Drupal\package_manager\Validator\ComposerValidator
will FAIL ifproc_open()
is disabled. But not in a way that we're catching today.So I think we should explicitly detect if
proc_open()
is available (if (!\function_exists('proc_open')) { โฆ
) as the first thing in\Drupal\package_manager\Validator\ComposerValidator::validate()
.
- Not catching
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 11:13am 15 May 2023 - Assigned to yash.rode
- Status changed to Needs work
over 1 year ago 12:22pm 15 May 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
The code looks fine but please refine both the formatting and the English. This is very sloppy: it looks hastily writtenโฆ ๐
- last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 8:07am 16 May 2023 - Status changed to Needs work
over 1 year ago 8:35am 16 May 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This still has very obvious problems.
- last update
over 1 year ago 788 pass - Status changed to Needs review
over 1 year ago 9:57am 16 May 2023 - Assigned to yash.rode
- Status changed to Needs work
over 1 year ago 12:03pm 16 May 2023 - last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:43pm 16 May 2023 - Assigned to yash.rode
- Status changed to Needs work
over 1 year ago 9:18am 17 May 2023 - last update
over 1 year ago 788 pass - last update
over 1 year ago 788 pass - Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:34am 17 May 2023 - Status changed to Needs work
over 1 year ago 12:54pm 17 May 2023 - last update
over 1 year ago 788 pass - Status changed to Needs review
over 1 year ago 5:58pm 17 May 2023 - ๐ฎ๐ณIndia yash.rode pune
Just changed comments so not expecting to fail that's why.
- Status changed to Needs work
over 1 year ago 12:46pm 18 May 2023 - Status changed to Needs review
over 1 year ago 1:39pm 18 May 2023 - last update
over 1 year ago 788 pass - Assigned to yash.rode
- Status changed to Needs work
over 1 year ago 8:55am 19 May 2023 - Assigned to wim leers
- Status changed to Needs review
over 1 year ago 9:50am 19 May 2023 - Issue was unassigned.
- last update
over 1 year ago 788 pass - last update
over 1 year ago 788 pass - Assigned to phenaproxima
- Status changed to RTBC
over 1 year ago 12:56pm 22 May 2023 - last update
over 1 year ago 788 pass - last update
over 1 year ago 788 pass -
phenaproxima โ
committed 84c4258e on 3.0.x authored by
yash.rode โ
Issue #3310729 by yash.rode, phenaproxima, Wim Leers, tedbow,...
-
phenaproxima โ
committed 84c4258e on 3.0.x authored by
yash.rode โ
- Status changed to Fixed
over 1 year ago 7:40pm 22 May 2023 - Issue was unassigned.
Automatically closed - issue fixed for 2 weeks with no activity.
- ๐บ๐ธUnited States traviscarden
FYI: I went ahead and added a precondition for this to Composer Stager itself: https://github.com/php-tuf/composer-stager/pull/192