Open Bug 1571684 Opened 5 years ago Updated 1 year ago

Avoid `./mach lint error: problem with lint setup, skipping android-api-lint, android-checkstyle, android-findbugs, android-lint, android-test` on Desktop builds

Categories

(Developer Infrastructure :: Lint and Formatting, task, P2)

Tracking

(Not tracked)

People

(Reporter: ato, Unassigned)

Details

When running the linter on the remote/ subfolder, the error seen below is consistent:

% ./mach lint -funix remote/
error: problem with lint setup, skipping android-api-lint, android-checkstyle, android-findbugs, android-lint, android-test

Let me know if there’s any other information I can provide.

I see this too, these checks were recently added to mozlint. I think this behaviour might be expected, but the message is confusing. Needinfo Nick just to verify. Should we suppress the error message in the case of these linters?

Flags: needinfo?(nalexander)

(In reply to Andrew Halberstadt [:ahal] from comment #1)

I see this too, these checks were recently added to mozlint. I think this behaviour might be expected, but the message is confusing. Needinfo Nick just to verify.

Yes, it's expected.

Should we suppress the error message in the case of these linters?

At the 11th hour I removed the "per-linter" error message, thinking it would be confusing to Desktop folks. But I didn't change the "harness-level" message. Let's change this to include some "condition" mechanism so that these can be ignored in some circumstances.

Flags: needinfo?(nalexander)
Summary: ./mach lint error: problem with lint setup, skipping android-api-lint, android-checkstyle, android-findbugs, android-lint, android-test → Avoid `./mach lint error: problem with lint setup, skipping android-api-lint, android-checkstyle, android-findbugs, android-lint, android-test` on Desktop builds

Does this also do any kind of network call? (After the initial run to install ESLint and the plugins). When I'm offline, I notice mach lint --fix path/to/file.js taking a while before printing that error. Online, it takes a few seconds.

(In reply to Lina Cambridge (she/her) [:lina] from comment #3)

Does this also do any kind of network call? (After the initial run to install ESLint and the plugins). When I'm offline, I notice mach lint --fix path/to/file.js taking a while before printing that error. Online, it takes a few seconds.

I'm not sure about these android ones, but yes several linters will try to make network calls. For example, to install dependencies or clone a repo (in the case of the l10n linter).

(In reply to Andrew Halberstadt [:ahal] from comment #4)

(In reply to Lina Cambridge (she/her) [:lina] from comment #3)

Does this also do any kind of network call? (After the initial run to install ESLint and the plugins). When I'm offline, I notice mach lint --fix path/to/file.js taking a while before printing that error. Online, it takes a few seconds.

I'm not sure about these android ones, but yes several linters will try to make network calls. For example, to install dependencies or clone a repo (in the case of the l10n linter).

The setup for the Android lints should not require a network. The runtime will, since it's all based on Gradle, which dynamically fetches dependencies as needed.

I think this pre-lint error is confusing because it can (especially
when run in Unix formatting mode) be mistaken for a lint problem.

Edit:

For example, consider this extract when dependencies are not
installed:
https://gist.github.com/andreastt/c2120a84451da18e69c6bc6cacfde844

In this case, there are no actual lint problems.

Priority: -- → P2

Can we avoid running these linters when no android-related files were modified? I assume they only do something meaningful for code in mobile/android and/or java files. Both not getting this error and avoiding additional lag without a network connection (per comment #5) would be helpful. I'm happy to help writing a patch but atm I have no idea where this code lives...

Flags: needinfo?(ahal)

Sure, though it's going to be tricky to implement that. I filed bug 1597277 which contains an explanation.

Also just to split hairs a little, we already do avoid running linters that don't have any files modified. It's just the setup functions that will run regardless. Unfortunately it's these setup functions that normally hit the network and print this Android error.

Flags: needinfo?(ahal)
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3

Could be nice, as well, when one tries to mach linter --setup to know why it is failing to perform the setup for Android: in my case, because I'm building desktop (though I have android changes in my patch)

You need to log in before you can comment on or make changes to this bug.