Page MenuHomeFreeBSD

devel/arcanist-lib: handle 'arc patch' runtime exception
ClosedPublic

Authored by jrm on Jan 6 2023, 5:43 PM.
Tags
None
Referenced Files
F170610074: D37969.id114803.diff
Sat, Sep 5, 3:25 PM
F170581546: D37969.id114803.diff
Sat, Sep 5, 12:26 PM
F170510510: D37969.diff
Sat, Sep 5, 4:11 AM
F170467186: D37969.diff
Fri, Sep 4, 11:22 PM
F170428151: D37969.id114805.diff
Fri, Sep 4, 7:05 PM
Unknown Object (File)
Thu, Sep 3, 3:19 PM
Unknown Object (File)
Thu, Sep 3, 1:13 PM
Unknown Object (File)
Thu, Sep 3, 12:20 PM
Subscribers

Details

Summary

Before patch, running arc patch could fail.

% arc patching D37961
 Exception
 preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
 (Run with `--trace` for a full exception trace.)

With --trace:

% arc patch --trace D37961
 ARGV  /usr/local/bin/arc patch --trace D37961
  PCNTL  Unable to install signal handler, pcntl_signal() unavailable. Continuing without signal handling.
  >>> [0] (+0) <exec> $ /usr/local/bin/php -f /usr/local/lib/php/arcanist/scripts/arcanist.php -- patch --trace D37961
   ARGV  /usr/local/lib/php/arcanist/scripts/arcanist.php patch --trace D37961
    LOAD  Loaded "arcanist" from "/usr/local/lib/php/arcanist/src".
    Config: Reading user configuration file "/home/jrm/.arcrc"...
    Config: Did not find system configuration at "/etc/arcconfig".
    Working Copy: Reading .arcconfig from "/usr/ports/.arcconfig".
    Working Copy: Path "/usr/ports/devel/arcanist-lib" is part of `git` working copy "/usr/ports".
    Working Copy: Project root is at "/usr/ports".
    Config: Did not find local configuration at "/usr/ports/.git/arc/config".
    >>> [0] (+0) <http> https://reviews.freebsd.org/api/differential.querydiffs
    <<< [0] (+636) <http> 636,457 us
    >>> [1] (+637) <http> https://reviews.freebsd.org/api/user.whoami
    <<< [1] (+692) <http> 55,693 us
    >>> [2] (+693) <http> https://reviews.freebsd.org/api/differential.querydiffs
    <<< [2] (+938) <http> 244,954 us
    >>> [3] (+947) <http> https://reviews.freebsd.org/api/repository.query
    <<< [3] (+1,003) <http> 56,653 us
    >>> [4] (+1,006) <exec> $ git --version
    <<< [4] (+1,016) <exec> 9,685 us
    >>> [5] (+1,016) <exec> $ git status --porcelain=2 -z
    <<< [5] (+1,531) <exec> 514,642 us

[2023-01-06 16:45:12] EXCEPTION: (RuntimeException) preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist()
  #0 PhutilErrorHandler::handleError(integer, string, string, integer)
  #1 preg_match(string, NULL, NULL) called at [<arcanist>/src/repository/api/ArcanistGitAPI.php:603]
  #2 ArcanistGitAPI::getCanonicalRevisionName(NULL) called at [<arcanist>/src/repository/api/ArcanistGitAPI.php:1146]
  #3 ArcanistGitAPI::hasLocalCommit(NULL) called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:433]
  #4 ArcanistPatchWorkflow::run() called at [<arcanist>/src/workflow/ArcanistPatchWorkflow.php:398]
  #5 ArcanistPatchWorkflow::run() called at [<arcanist>/scripts/arcanist.php:427]
<<< [0] (+1,563) <exec> 1,563,354 us
Test Plan

run-time test resolves the error in the case above

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable