Closed Bug 1631603 Opened 4 years ago Closed 4 years ago

`./mach lint -l android-api-lint` produces python error

Categories

(GeckoView :: General, task, P1)

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: kats, Assigned: agi)

References

Details

(Whiteboard: [geckoview:m77])

Attachments

(1 file)

I made some changes that involved deleting stuff from the geckoview api.txt file. I was told that running ./mach lint -l android-api-lint would let me know of any problems. Instead I get this:

Traceback (most recent call last):
  File "/home/kats/zspace/gecko-misc/python/mozlint/mozlint/roller.py", line 60, in _run_worker
    res = func(paths, config, **lintargs) or []
  File "/home/kats/zspace/gecko-misc/python/mozlint/mozlint/types.py", line 54, in __call__
    return self._lint(paths, config, **lintargs)
  File "/home/kats/zspace/gecko-misc/python/mozlint/mozlint/types.py", line 159, in _lint
    return func(config, **lintargs)
  File "/home/kats/zspace/gecko-misc/tools/lint/android/lints.py", line 88, in api_lint
    issues = json.load(f)
  File "/usr/lib/python3.5/json/__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
A failure occurred in the android-api-lint linter.
✖ 1 problem (0 errors, 0 warnings, 1 failure)

As far as I can tell this is trying to read an apilint-result.json file from my objdir. There's only one such file, and it's empty. So attempting to json.load it produces an error.

And the error is showing up on try pushes, too: https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=78e4e7bebf8d24f45edf35b33d1a84dd2becaeaa

The apilint-result.json artifact on the lint job has this:

{
  "reason": "file-missing-on-worker",
  "message": "Artifact \"public/android/geckoview/apilint-result.json\" not found at \"/builds/worker/checkouts/gecko/obj-firefox/gradle/build/mobile/android/geckoview/intermediates/classes/withGeckoBinaries/debug/apilint-result.json\""
}

Hey Nick, any idea why this file might be empty/missing?

Flags: needinfo?(nalexander)

Subsequent try push with slightly modified code (fixed the dangling import statements in java code, etc.) now seem to be killing gradle: https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=7ed7bc72c4c0bcc31ab60ddba291ba602a85afc1

Assignee: nobody → agi

I ran the lint command with --verbose which emitted a gradle command it was running under the hood. Running that manually pointed to an error in my changes to api.txt. Fixing that (and subsequently bumping the API version in a changelog.md file) fixed my linting errors.

Flags: needinfo?(nalexander)
Component: Lint and Formatting → General
Product: Firefox Build System → GeckoView
Priority: -- → P1
Whiteboard: [geckoview:m77]

This version includes the following commits:

d89245f Update com.gradle.plugin-publish to 0.11.0.
17bc5ea Closes #77: Don't fail when the map index is out of range.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: