The last line of python/mozbuild/mozbuild/test/backend/data/linkage/templates.mozbuild is ignored

RESOLVED FIXED

Status

enhancement
RESOLVED FIXED
4 months ago
4 months ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 months ago
That's because the last line of the file doesn't have a newline, and older python versions have a buggy inspect.getblock:

    $ python
    Python 2.7.9 (default, Nov  8 2018, 08:36:59) 
    [GCC 4.7.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import inspect
    >>> print inspect.getblock([
    ...     'def foo():\n',
    ...     '    a = 1\n',
    ...     '    bar()',
    ... ])
    ['def foo():\n', '    a = 1\n']
    ​
    $ python
    Python 2.7.15+ (default, Aug 31 2018, 11:56:52) 
    [GCC 8.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import inspect
    >>> print inspect.getblock([
    ...     'def foo():\n',
    ...     '    a = 1\n',
    ...     '    bar()',
    ... ])
    ['def foo():\n', '    a = 1\n', '    bar()']
(Assignee)

Comment 1

4 months ago
Fixing this unveils an issue in TestRecursiveMake::test_linkage that
was happening locally but not on automation, due to the Binary()
template never being invoked on automation.

Comment 2

4 months ago
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/75572e56c170
Compensate for older python's buggy inspect.getblock. r=nalexander

Comment 3

4 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/75572e56c170
Status: NEW → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.