Skip to content

"mbed compile" fails with "list index out of range" #3226

@infinnovation-dev

Description

@infinnovation-dev

Description

  • Type: Bug
  • Related issue: #abc
  • Priority: Minor

Bug

Target
K64F

Toolchain:
GCC_ARM

Toolchain version:
4_9-2015q3

mbed-cli version:
0.9.10

meed-os sha:
e2617cc

Expected behavior
Failed compilation should not propagate to next compilation attempt

Actual behavior
In some circumstances, a failed compilation results in the next "mbed compile" reporting

...
Scan: mbed
Scan: env
[ERROR] list index out of range
[mbed] ERROR: "python" returned error code 1.

Steps to reproduce
Ah, you've got me there! I haven't been able to determine the exact circumstances. What I have found is that somehow a .d file may be left empty after a failed compilation. In one example, the error was a missing include file referenced by main.cpp, but the file BUILD/K64F/GCC_ARM/mbed-os/events/equeue/equeue_mbed.d was left empty.

When an empty .d file is present, GCC.parse_dependencies in tools/toolschains/gcc,py falls over when trying to access the first line of the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions