Page MenuHomePhabricator

Some linters fail without a pathway forward if the PHP "xml" extension is not installed
Open, Needs TriagePublic

Description

I recently updated to Ubuntu 16.04 and as part of that now run php-cli7.0.4. I now find that trying to run arc lint seems to fail. Note this is client side, I am no involving the server, just trying to lint locally. I am happy to provide phabricator server details if you think they are relevant (running on 14.04, tracking stable releases).

Based on the trace below I tried removing the CSS Lint options from my arclint file (also below), but then saw an error from the JSCS lint. I'm guessing that I've buggered some part of arcanist/libphutil by upgrading to PHP 7. Could you point me at where? If not perhaps there is a dependency I need or something? Failing that I guess I'll need to get PHP5 back.

All of this used to work flawlessly prior to upgrading to Ubuntu 16.04. I don't know if anything in T9640 is relevant?

Let me know if there's anything else I can provide to resolve, its likely something silly that happened during the upgrade from 15.10 to 16.04... The expected result from arc lint was for everything to be okay in the repo.

Reproduction Steps:

  1. Upgrade to 16.04
  2. Use php7.0-cli to re-enable PHP support, my upgrade seemed to wipeout PHP...
  3. In the repo, run arc lint...

Arc Version:

arcanist 2374403e8f80a8fb16cdc1ce2843f932632e8cf0 (17 Jun 2016)
libphutil 51c179b4c000de34d85a62188b5f9efb28afba73 (17 Jun 2016)

PHP:

which php && php --version

/usr/bin/php
PHP 7.0.4-7ubuntu2.1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

PHP Installed packages:

dpkg -l | grep php

ii  php-common                                                  1:35ubuntu6                                         all          Common files for PHP packages
ii  php7.0-cli                                                  7.0.4-7ubuntu2.1                                    amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                                               7.0.4-7ubuntu2.1                                    amd64        documentation, examples and common module for PHP
ii  php7.0-curl                                                 7.0.4-7ubuntu2.1                                    amd64        CURL module for PHP
ii  php7.0-json                                                 7.0.4-7ubuntu2.1                                    amd64        JSON module for PHP
ii  php7.0-opcache                                              7.0.4-7ubuntu2.1                                    amd64        Zend OpCache module for PHP
ii  php7.0-readline                                             7.0.4-7ubuntu2.1                                    amd64        readline module for PHP

System Info:

lsb_release -a

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04 LTS
Release:	16.04
Codename:	xenial

uname -a
Linux Sam-UB-Desktop 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Full trace:

arc lint --trace
 ARGV  '/home/sam/bin/phabricator-tools/arcanist/bin/../scripts/arcanist.php' 'lint' '--trace'
 LOAD  Loaded "phutil" from "/home/sam/bin/phabricator-tools/libphutil/src".
 LOAD  Loaded "arcanist" from "/home/sam/bin/phabricator-tools/arcanist/src".
Config: Reading user configuration file "/home/sam/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "<REDACTED>".
Working Copy: Path "<REDACTED>" is part of `git` working copy "<REDACTED>".
Working Copy: Project root is at "<REDACTED>".
Config: Did not find local configuration at "<REDACTED>/.git/arc/config".
>>> [0] <exec> $ git rev-parse --verify HEAD^
<<< [0] <exec> 1,928 us
>>> [1] <exec> $ git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'
<<< [1] <exec> 1,464 us
>>> [2] <exec> $ git cat-file -t 'master'
<<< [2] <exec> 1,491 us
>>> [3] <exec> $ git merge-base 'master' HEAD
<<< [3] <exec> 1,514 us
>>> [4] <exec> $ git diff --no-ext-diff --no-textconv --raw '15c97fb39db1e85474498de57c39104ecbbb4a7e' --
<<< [4] <exec> 9,230 us
>>> [5] <exec> $ git diff --no-ext-diff --no-textconv --raw 'HEAD' --
>>> [6] <exec> $ git ls-files --others --exclude-standard
<<< [6] <exec> 2,350 us
<<< [5] <exec> 9,738 us
>>> [7] <exec> $ git diff-files --name-only
<<< [7] <exec> 8,043 us
>>> [8] <exec> $ git diff --no-ext-diff --no-textconv --no-color --src-prefix=a/ --dst-prefix=b/ -U32767 -M -C '15c97fb39db1e85474498de57c39104ecbbb4a7e' --
<<< [8] <exec> 9,341 us
Examining paths for linter 'Python Flake8 Linter'.
Found 0 matching paths for linter 'Python Flake8 Linter'.
Examining paths for linter 'Python Pylint Linter'.
Found 0 matching paths for linter 'Python Pylint Linter'.
Examining paths for linter 'Filename Checks'.
Found 11 matching paths for linter 'Filename Checks'.
Examining paths for linter 'Spelling'.
Found 11 matching paths for linter 'Spelling'.
Examining paths for linter 'JSON Checks'.
Found 1 matching paths for linter 'JSON Checks'.
Examining paths for linter 'Merge-Conflicts'.
Found 11 matching paths for linter 'Merge-Conflicts'.
Examining paths for linter 'JSCS'.
Found 1 matching paths for linter 'JSCS'.
Examining paths for linter 'JSON Hint'.
Found 1 matching paths for linter 'JSON Hint'.
Examining paths for linter 'CSS Lint'.
Found 1 matching paths for linter 'CSS Lint'.
>>> [9] <exec> $ which 'flake8'
<<< [9] <exec> 1,539 us
>>> [10] <exec> $ which 'flake8'
<<< [10] <exec> 1,165 us
>>> [11] <exec> $ 'flake8' --version
<<< [11] <exec> 176,311 us
>>> [12] <exec> $ which 'pylint'
<<< [12] <exec> 1,465 us
>>> [13] <exec> $ which 'pylint'
<<< [13] <exec> 1,162 us
>>> [14] <exec> $ 'pylint' --version
<<< [14] <exec> 217,473 us
>>> [15] <exec> $ which 'pylint'
<<< [15] <exec> 1,518 us
>>> [16] <exec> $ 'pylint' --version
<<< [16] <exec> 215,687 us
>>> [17] <exec> $ which 'jscs'
<<< [17] <exec> 1,487 us
>>> [18] <exec> $ which 'jscs'
<<< [18] <exec> 1,127 us
>>> [19] <exec> $ 'jscs' --version
<<< [19] <exec> 384,155 us
>>> [20] <exec> $ which 'jshint'
<<< [20] <exec> 1,412 us
>>> [21] <exec> $ which 'jshint'
<<< [21] <exec> 1,566 us
>>> [22] <exec> $ 'jshint' --version
<<< [22] <exec> 135,976 us
>>> [23] <exec> $ which 'csslint'
<<< [23] <exec> 1,559 us
>>> [24] <exec> $ which 'csslint'
<<< [24] <exec> 1,158 us
>>> [25] <exec> $ 'csslint' --version
<<< [25] <exec> 46,089 us
>>> [26] <lint> Filename <paths = 11>
<<< [26] <lint> 93 us
>>> [27] <lint> Spellchecker <paths = 9>
<<< [27] <lint> 7,724 us
>>> [28] <lint> JSON Lint <paths = 1>
<<< [28] <lint> 1,250 us
>>> [29] <lint> Merge Conflicts <paths = 9>
<<< [29] <lint> 108 us
>>> [30] <lint> JavaScript Code Style <paths = 1>
>>> [31] <exec> $ which 'jscs'
<<< [31] <exec> 1,960 us
>>> [32] <exec> $ 'jscs' '--reporter=checkstyle' '--no-colors' '<REDACTED>/nodeDemo.js'
<<< [30] <lint> 3,087 us
>>> [33] <lint> JavaScript error checking <paths = 1>
>>> [34] <exec> $ which 'jshint'
<<< [34] <exec> 1,410 us
>>> [35] <exec> $ 'jshint' '--reporter=/home/sam/bin/phabricator-tools/arcanist/src/lint/linter/reporter.js' '<REDACTED>/nodeDemo.js'
<<< [33] <lint> 2,517 us
>>> [36] <lint> CSSLint <paths = 1>
>>> [37] <exec> $ which 'csslint'
<<< [37] <exec> 1,804 us
>>> [38] <exec> $ 'csslint' '--format=lint-xml' '<REDACTED>/public/css/theme.css'
<<< [36] <lint> 3,125 us
>>> [39] <lint> Filename <paths = 11>
<<< [39] <lint> 34 us
>>> [40] <lint> Spellchecker <paths = 9>
<<< [40] <lint> 65 us
>>> [41] <lint> JSON Lint <paths = 1>
<<< [41] <lint> 15 us
>>> [42] <lint> Merge Conflicts <paths = 9>
<<< [42] <lint> 11 us
>>> [43] <lint> JavaScript Code Style <paths = 1>
<<< [32] <exec> 486,034 us
<<< [43] <lint> 479,300 us
>>> [44] <lint> JavaScript error checking <paths = 1>
<<< [35] <exec> 483,753 us
<<< [44] <lint> 112 us
>>> [45] <lint> CSSLint <paths = 1>
<<< [38] <exec> 480,871 us
<<< [45] <lint> 131 us

[2016-06-20 12:34:24] EXCEPTION: (PhutilAggregateException) Some linters failed:
    - PhutilMissingSymbolException: Failed to load class or interface 'DOMDocument': the class or interface 'DOMDocument' is not defined in the library map for any loaded phutil library.
      
      If you are not a developer, this almost always means that a library is out of date. For example, you may have upgraded `phabricator` without upgrading `libphutil`, or vice versa. It might also mean that you need to restart Apache or PHP-FPM. Make sure all libraries are up to date and all services have been restarted.
      
      If you are a developer and this symbol was recently added or moved, your library map may need to be rebuilt. You can rebuild the map by running 'arc liberate'. For more information, see:
      
      https://secure.phabricator.com/book/phabcontrib/article/adding_new_classes/
    - PhutilMissingSymbolException: Failed to load class or interface 'DOMDocument': the class or interface 'DOMDocument' is not defined in the library map for any loaded phutil library.
      
      If you are not a developer, this almost always means that a library is out of date. For example, you may have upgraded `phabricator` without upgrading `libphutil`, or vice versa. It might also mean that you need to restart Apache or PHP-FPM. Make sure all libraries are up to date and all services have been restarted.
      
      If you are a developer and this symbol was recently added or moved, your library map may need to be rebuilt. You can rebuild the map by running 'arc liberate'. For more information, see:
      
      https://secure.phabricator.com/book/phabcontrib/article/adding_new_classes/ at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:274]
arcanist(head=master, ref.master=2374403e8f80), phutil(head=master, ref.master=51c179b4c000)
  #0 <#3> spl_autoload_call(string) called at [<arcanist>/src/lint/linter/ArcanistCSSLintLinter.php:58]
  #1 <#2> __phutil_autoload(string) called at [<phutil>/src/__phutil_library_init__.php:25]
  #2 <#2> spl_autoload_call(string) called at [<arcanist>/src/lint/linter/ArcanistJscsLinter.php:97]
  #3 <#2> ArcanistJscsLinter::parseLinterOutput(string, integer, string, string) called at [<arcanist>/src/lint/linter/ArcanistExternalLinter.php:437]
  #4 <#2> ArcanistExternalLinter::resolveFuture(string, ExecFuture) called at [<arcanist>/src/lint/linter/ArcanistFutureLinter.php:34]
  #5 <#2> ArcanistFutureLinter::didLintPaths(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:594]
  #6 <#2> ArcanistLintEngine::executeDidLintOnPaths(ArcanistJscsLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:545]
  #7 <#2> ArcanistLintEngine::executeLintersOnChunk(array, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:473]
  #8 <#2> ArcanistLintEngine::executeLinters(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:216]
  #9 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:334]
  #10 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]

ArcLint file for repository:

{
  "linters": {
    "Python Flake8 Linter": {
      "type": "flake8",
      "include": "(\\.py$)",
      "exclude": "(^third-party/)",
      "flags": [
        "--jobs=auto"
      ]
    },
    "Python Pylint Linter": {
      "type": "pylint",
      "include": "(\\.py$)",
      "exclude": "(^third-party/)",
      "flags": [
        "--jobs=4"
      ]
    },
    "Filename Checks": {
      "type": "filename"
    },
    "Spelling": {
      "type": "spelling",
      "exclude": "(mibs/)"
    },
    "JSON Checks": {
      "type": "json",
      "include": "(\\.json$)"
    },
    "Merge-Conflicts": {
      "type": "merge-conflict"
    },
    "JSCS": {
      "type": "jscs",
      "include": "(\\.js$)",
      "exclude": "(node_modules/)"
    },
    "JSON Hint": {
      "type": "jshint",
      "include": "(\\.js$)",
      "exclude": "(node_modules/)"
    },
    "CSS Lint": {
      "type": "csslint",
      "include": "(\\.css$)"
    }
  }
}

Arc linters

arc linters
 AVAILABLE   text (Basic Text Linter)
 AVAILABLE   csharp (C#)
 AVAILABLE   cpplint (C++ Google's Styleguide)
 AVAILABLE   cppcheck (C++ linter)
 AVAILABLE   lessc (CSS pre-processor)
 AVAILABLE   csslint (CSSLint)
 AVAILABLE   chmod (Chmod)
 AVAILABLE   gjslint (Closure Linter)
 AVAILABLE   coffeelint (CoffeeLint)
 AVAILABLE   composer (Composer Dependency Manager)
 CONFIGURED  filename (Filename)
 AVAILABLE   generated (Generated Code)
 AVAILABLE   golint (Golint)
 AVAILABLE   hlint (Haskell Linter)
 AVAILABLE   jsonlint (JSON Lint)
 CONFIGURED  json (JSON Lint)
 CONFIGURED  jscs (JavaScript Code Style)
 CONFIGURED  jshint (JavaScript error checking)
 AVAILABLE   nolint (Lint Disabler)
 CONFIGURED  merge-conflict (Merge Conflicts)
 AVAILABLE   phpcs (PHP_CodeSniffer)
 AVAILABLE   phutil-library (Phutil Library Linter)
 CONFIGURED  pylint (PyLint)
 CONFIGURED  flake8 (Python Flake8 multi-linter)
 AVAILABLE   pep8 (Python PEP 8)
 AVAILABLE   pyflakes (Python PyFlakes)
 AVAILABLE   ruby (Ruby)
 AVAILABLE   rubocop (Ruby static code analyzer)
 AVAILABLE   script-and-regex (Script and Regex)
 AVAILABLE   xml (SimpleXML Linter)
 CONFIGURED  spelling (Spellchecker)
 AVAILABLE   xhpast (XHPAST Lint)
 AVAILABLE   php (php -l)
 AVAILABLE   puppet-lint (puppet-lint)

Linter Versions:

pylint --version
No config file found, using default configuration
pylint 1.5.6, 
astroid 1.4.6
Python 3.5.1+ (default, Mar 30 2016, 22:46:26) 
[GCC 5.3.1 20160330]

flake8 --version
2.6.0 (pycodestyle: 2.0.0, pyflakes: 1.2.3, mccabe: 0.5.0) CPython 3.5.1+ on Linux

jscs --version
2.3.2

jshint --version
jshint v2.9.2

Event Timeline

Sam2304 created this task.Jun 20 2016, 1:09 PM
Sam2304 updated the task description. (Show Details)Jun 20 2016, 1:15 PM

Run your-package-manager install php-xml or php5-xml or php7-xml or whatever it's called on your system.

See also T2383.

Damn man you're good.

Command to resolve in my case:

sudo apt-get install php7.0-xml

Following that arc lint runs as expected.

Mildly miffed I managed to miss that. Thank you for the lightspeed response.

epriestley renamed this task from Arc lint fails on Ubuntu 16.04 to Some linters fail without a pathway forward if the PHP "xml" extension is not installed.Jun 20 2016, 6:37 PM
joshuaspence added a project: Lint.