Arc diff fails on incompatible linter rule with PHP7.3


#1

Observed Behavior:

The ArcanistPHPCompatibilityXHPASTLinterRule has a switch / continue here:

[2018-12-11 22:31:08] EXCEPTION: (Exception) Error while loading file "/usr/share/php/arcanist/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php": "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? at [<phutil>/src/moduleutils/PhutilBootloader.php:277]
arc-cwn(), arcanist(), phutil()
  #0 PhutilBootloader::executeInclude(string) called at [<phutil>/src/moduleutils/PhutilBootloader.php:213]
  #1 PhutilBootloader::loadLibrarySource(string, string) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:381]
  #2 PhutilSymbolLoader::loadSymbol(array) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:256]
  #3 PhutilSymbolLoader::selectAndLoadSymbols() called at [<phutil>/src/symbols/PhutilSymbolLoader.php:324]
  #4 PhutilClassMapQuery::execute() called at [<arcanist>/src/lint/linter/xhpast/ArcanistXHPASTLinterRule.php:15]
  #5 ArcanistXHPASTLinterRule::loadAllRules() called at [<arcanist>/src/lint/linter/ArcanistXHPASTLinter.php:14]
  #6 ArcanistXHPASTLinter::__construct()
  #7 ReflectionClass::newInstance() called at [<phutil>/src/utils/utils.php:748]
  #8 newv(string, array) called at [<phutil>/src/symbols/PhutilSymbolLoader.php:328]
  #9 PhutilSymbolLoader::loadObjects() called at [<phutil>/src/symbols/PhutilClassMapQuery.php:239]
  #10 PhutilClassMapQuery::loadMap() called at [<phutil>/src/symbols/PhutilClassMapQuery.php:179]
  #11 PhutilClassMapQuery::execute() called at [<arcanist>/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php:143]
  #12 ArcanistConfigurationDrivenLintEngine::loadAvailableLinters() called at [<arcanist>/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php:32]
  #13 ArcanistConfigurationDrivenLintEngine::buildLinters() called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:166]
  #14 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:337]
  #15 ArcanistLintWorkflow::run() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1250]
  #16 ArcanistDiffWorkflow::runLint() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:1211]
  #17 ArcanistDiffWorkflow::runLintUnit() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:483]
  #18 ArcanistDiffWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]

Expected Behavior:
I think phabricator should use continue 2 here.

Making the diff locally

diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php
index d73d1fae..19e31358 100644
--- a/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php
@@ -70,7 +70,7 @@ final class ArcanistPHPCompatibilityXHPASTLinterRule
           $symbol = $params->getChildByIndex(0);
 
           if (!$symbol->isStaticScalar()) {
-            continue;
+            continue 2;
           }
 
           $symbol_name = $symbol->evalStatic();`

solved the issue for me.

Phabricator Version:
arcanist 3534d2baca4bf6dcdac46c49164bf5ba3a6660ad (8 Nov 2018)
libphutil 1e590fd9e58e1e5e07954ad1ddc25a78add62abd (6 Dec 2018)

Reproduction Steps:
Install PHP 7.3.0 (cli) (built: Dec 8 2018 12:11:20) ( NTS )
On arch, this is the version that landed on Extra on Dec 9 2018.

Pull libphutil and arcanist from git.

Run arc diff.


#2

Thanks, see https://secure.phabricator.com/D19868.


#3