Closed Bug 1526062 Opened 5 years ago Closed 5 years ago

NameError: global name 'version' is not defined when building with a wrong NDK directory

Categories

(Firefox Build System :: Android Studio and Gradle Integration, defect)

defect
Not set
normal

Tracking

(firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(5 files)

When you have --with-android-ndk=wrong-path in your mozconfig, configure fails with:

 0:00.82   File "/home/glandium/gecko/build/moz.configure/android-ndk.configure", line 225, in android_toolchain
 0:00.82     toolchain = toolchain_format % (ndk, target_base, version,
 0:00.82 NameError: global name 'version' is not defined

Seems like the configure lint should check for this.

Assignee: nobody → mh+mozilla

Regression from bug 1350822.

Blocks: 1350822

Depends on D19109

Using the assert keyword actually generates bytecode that uses the
AssertionError class under the hood. Ideally, we should probably not
use asserts in python configure, but there are currently so many that
it's easier to allow it, until a better strategy is decided upon.

Depends on D19110

Currently, running the configure lint will raise errors with little
context, if any, which can make finding the cause of the errors tedious.

So instead of raising exceptions directly, we use a hack to make the
exception appear as if they had been thrown at the code location an
issue is reported for, which makes the test harness print more useful
context.

With more context, printed out, some exception messages can be made
lighter.

The added _raise_from method does more than is necessary here, but will
be fully used in a new check shortly.

Depends on D19111

There are cases that can be easily detected where an undefined variable
is used, and such mistakes seem to happen more often than they should,
as all the errors fixed in the previous patches (that this new lint
caught).

Depends on D19112

Pushed by dvarga@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/358cf23ac448
Fix miscellaneous NameErrors lingering in the python configure code. r=nalexander
https://hg.mozilla.org/mozilla-central/rev/61464095c91a
Add missing imports for Exception. r=nalexander
https://hg.mozilla.org/mozilla-central/rev/9fcb810cde87
Add AssertionError to the python configure sandbox builtins. r=nalexander
https://hg.mozilla.org/mozilla-central/rev/817c1e5b3d0a
Improve error reporting by the configure lint. r=nalexander
https://hg.mozilla.org/mozilla-central/rev/af6a8b058f9a
Add a configure lint for undefined variables. r=nalexander
Product: Firefox for Android → Firefox Build System
Target Milestone: Firefox 67 → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: