Closed Bug 1579022 Opened 5 years ago Closed 5 years ago

./mach doc broken with

Categories

(Developer Infrastructure :: Source Documentation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1556460

People

(Reporter: whimboo, Unassigned)

Details

I'm working on updates for the geckodriver documentation, but running the command mach doc testing/geckodriver always results in the following failure:

Generating Python API documentation
WARNING: The config value `js_source_path' has type `list', defaults to `str'.

Exception occurred:
  File "/Users/henrik/.pyenv/versions/2.7.16/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
The full traceback has been saved in /var/folders/c2/q_47wqh13n902fj9_zxczclr0000gn/T/sphinx-err-I5mqJb.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
/Users/henrik/code/gecko/mach: failed to generate documentation:
/Users/henrik/code/gecko/testing/geckodriver: sphinx return code 2

The log file contains the following:

cat /var/folders/c2/q_47wqh13n902fj9_zxczclr0000gn/T/sphinx-err-I5mqJb.log
# Sphinx version: 1.8.5
# Python version: 2.7.16 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.10.1
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "/Users/henrik/code/gecko/obj/mobile/_virtualenvs/docs-7n67XPfa/lib/python2.7/site-packages/sphinx/cmd/build.py", line 303, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/Users/henrik/code/gecko/obj/mobile/_virtualenvs/docs-7n67XPfa/lib/python2.7/site-packages/sphinx/application.py", line 263, in __init__
    self._init_builder()
  File "/Users/henrik/code/gecko/obj/mobile/_virtualenvs/docs-7n67XPfa/lib/python2.7/site-packages/sphinx/application.py", line 325, in _init_builder
    self.emit('builder-inited')
  File "/Users/henrik/code/gecko/obj/mobile/_virtualenvs/docs-7n67XPfa/lib/python2.7/site-packages/sphinx/application.py", line 510, in emit
    return self.events.emit(event, self, *args)
  File "/Users/henrik/code/gecko/obj/mobile/_virtualenvs/docs-7n67XPfa/lib/python2.7/site-packages/sphinx/events.py", line 80, in emit
    results.append(callback(*args))
  File "/Users/henrik/code/gecko/obj/mobile/_virtualenvs/docs-7n67XPfa/lib/python2.7/site-packages/sphinx_js/jsdoc.py", line 35, in run_jsdoc
    doclets = load(temp)
  File "/Users/henrik/.pyenv/versions/2.7.16/lib/python2.7/json/__init__.py", line 291, in load
    **kw)
  File "/Users/henrik/.pyenv/versions/2.7.16/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/Users/henrik/.pyenv/versions/2.7.16/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/henrik/.pyenv/versions/2.7.16/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

I run a mach bootstrap too in case something might have been changed, but nothing changed.

Andrew, do you have an idea?

Flags: needinfo?(ahal)

Note that something might be wrong with the jsdoc command, which results in this json parse error because the used temporary file is empty.

The executed jsdoc command is:

jsdoc /Users/henrik/code/gecko/browser/components/extensions /Users/henrik/code/gecko/testing/marionette /Users/henrik/code/gecko/toolkit/components/extensions /Users/henrik/code/gecko/toolkit/components/extensions/parent /Users/henrik/code/gecko/toolkit/components/featuregates /Users/henrik/code/gecko/toolkit/mozapps/extensions -X -c tools/docs/jsdoc.json

And the failure:

/usr/local/lib/node_modules/jsdoc/node_modules/requizzle/lib/requizzle.js:45
	if (lookupPaths[0] === targetPath && lookupPaths[1].length === 0) {
	               ^

TypeError: Cannot read property '0' of null
    at isNativeModule (/usr/local/lib/node_modules/jsdoc/node_modules/requizzle/lib/requizzle.js:45:17)
    at Requizzle.requizzle (/usr/local/lib/node_modules/jsdoc/node_modules/requizzle/lib/requizzle.js:82:6)
    at infectProxy (/usr/local/lib/node_modules/jsdoc/node_modules/requizzle/lib/loader.js:82:28)
    at Module.targetModule.require (/usr/local/lib/node_modules/jsdoc/node_modules/requizzle/lib/loader.js:101:11)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/jsdoc/lib/jsdoc/fs.js:7:10)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Object.load (/usr/local/lib/node_modules/jsdoc/node_modules/requizzle/lib/loader.js:112:15)

Re-installing jsdoc via npm install -g jsdoc solved it. So maybe there was a problem with some dependencies? Given that mach bootstrap cannot handle the npm package installation yet, it can also not take care of update proposals for various installed packages?

It would be great to not have to figure out the above all on its own, but to get a warning to upgrade the jsdoc package.

No longer blocks: 1525126
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(ahal)
Resolution: --- → DUPLICATE
Summary: WARNING: The config value `js_source_path' has type `list', defaults to `str' → ./mach doc broken with
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.