Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: string indices must be integers: #3400

Closed
1 task
hansj66 opened this issue Feb 16, 2020 · 3 comments
Closed
1 task

TypeError: string indices must be integers: #3400

hansj66 opened this issue Feb 16, 2020 · 3 comments
Assignees
Labels
bug ldf Library Dependency Finder
Milestone

Comments

@hansj66
Copy link

hansj66 commented Feb 16, 2020

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system:

OS Name: Microsoft Windows 10 Home
OS Version: 10.0.18362 N/A Build 18362

PlatformIO Version (platformio --version):

PlatformIO, version 4.2.0

Description of problem

Build fails with "TypeError: string indices must be integers:" during dependency scan

Steps to Reproduce

  1. create a new project. (BBC Microbit board, MBed framework)
  2. add "lib_deps = microbit-dal" to platformio.ini
  3. add "#include "MicroBitDisplay.h" to main.cpp (or any other microbit-dal header)

Actual Results

Executing task: C:\Users\hansj.platformio\penv\Scripts\platformio.exe run <

Processing bbcmicrobit (platform: nordicnrf51; board: bbcmicrobit; framework: mbed)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf51/bbcmicrobit.html
PLATFORM: Nordic nRF51 5.0.2 > BBC micro:bit
HARDWARE: NRF51822 16MHz, 16KB RAM, 256KB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap) External (jlink)
PACKAGES:

  • framework-mbed 5.51105.190312 (5.11.5)
  • tool-sreccat 1.164.0 (1.64)
  • toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 7 compatible libraries
    Scanning dependencies...
    TypeError: string indices must be integers:
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\main.py", line 156:
    env.SConscript("$BUILD_SCRIPT")
    File "C:\Users\hansj.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
    File "C:\Users\hansj.platformio\packages\tool-scons\script..\engine\SCons\Script\SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
    File "C:\Users\hansj.platformio\platforms\nordicnrf51\builder\main.py", line 115:
    target_elf = env.BuildProgram()
    File "C:\Users\hansj.platformio\packages\tool-scons\script..\engine\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 62:
    env.ProcessProjectDeps()
    File "C:\Users\hansj.platformio\packages\tool-scons\script..\engine\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 131:
    project_lib_builder = env.ConfigureProjectLibBuilder()
    File "C:\Users\hansj.platformio\packages\tool-scons\script..\engine\SCons\Environment.py", line 219:
    return self.method(*nargs, **kwargs)
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 1041:
    project.search_deps_recursive()
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 404:
    self.process_dependencies()
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 890:
    self.depend_recursive(lb)
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 399:
    lb.search_deps_recursive(search_files)
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 404:
    self.process_dependencies()
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 283:
    self.depend_recursive(lb)
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 399:
    lb.search_deps_recursive(search_files)
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 404:
    self.process_dependencies()
    File "C:\Users\hansj.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 279:
    if item["name"] != lb.name:
    =========================== [FAILED] Took 2.53 seconds ===========================
    The terminal process terminated with exit code: 1

Expected Results

Successful compilation

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:bbcmicrobit]
platform = nordicnrf51
board = bbcmicrobit
framework = mbed
lib_deps = microbit-dal

Source file to reproduce issue:

#include <mbed.h>
#include "MicroBitDisplay.h"

int main() {
  while(1) {
  }
}

Additional info

The microbit-dal library hasn't changed. It is still available in the registry. On my machine It is listed as installed in "PIO Home" along with "ble" and "ble-nrf51822"
I get the same behaviour from PIO on macOS (10.15.2)

@ivankravets ivankravets transferred this issue from platformio/platformio-core Feb 17, 2020
@franzle
Copy link

franzle commented Feb 25, 2020

I have exactly the same problem with a project with the ble" and "ble-nrf51822" libraries.
I would really need a solution, it stopped compiling with release 4.2.0 onward.
Before it was OK

francesco

@knud
Copy link

knud commented Feb 26, 2020 via email

@ivankravets ivankravets transferred this issue from platformio/platform-nordicnrf51 Mar 2, 2020
@ivankravets ivankravets added this to the 4.2.2 milestone Mar 2, 2020
@ivankravets ivankravets self-assigned this Mar 2, 2020
@ivankravets ivankravets added help wanted bug ldf Library Dependency Finder and removed help wanted labels Mar 2, 2020
@ivankravets
Copy link
Member

Thanks for the report!

  1. Upgrade PIO Core to the latest development version via pio upgrade --dev
  2. Please remove .pio folder from a project
  3. Start buidling project.

Does it work now?
2. re-run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ldf Library Dependency Finder
Projects
None yet
Development

No branches or pull requests

4 participants