platformio / platform-atmelsam

Atmel SAM: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelsam
Apache License 2.0
79 stars 105 forks source link

RuntimeError when using old pinned versions of atmelsam #101

Closed tfeldmann closed 3 years ago

tfeldmann commented 4 years ago

Using a pinned, older version fails with a RuntimeError. (PlatformIO version 4.3.1, running on Python 3.7.7 using pipx).

pio run  

Processing device (platform: atmelsam@3.1.2; framework: arduino; board: dueUSB)
------------------------------------------------------------------------------------------------------------------------------------------------------------
PlatformManager: Installing atmelsam @ 3.1.2
Downloading  [####################################]  100%
atmelsam @ 3.1.2 has been successfully installed!
The platform 'atmelsam@3.1.2' has been successfully installed!
The rest of packages will be installed automatically depending on your build environment.
Error: Traceback (most recent call last):
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/platformio/__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/platformio/commands/__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/platformio/commands/run/command.py", line 138, in cli
    is_test_running,
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/platformio/commands/run/command.py", line 170, in process_env
    result = {"env": name, "duration": time(), "succeeded": ep.process()}
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/platformio/commands/run/processor.py", line 81, in process
    result = p.run(build_vars, build_targets, self.silent, self.verbose, self.jobs)
  File "/Users/tf/.local/pipx/venvs/platformio/lib/python3.7/site-packages/platformio/managers/platform.py", line 398, in run
    self.configure_default_packages(options, targets)
  File "/Users/tf/.platformio/platforms/atmelsam@3.1.2/platform.py", line 33, in configure_default_packages
    for name, opts in self.packages.items():
RuntimeError: dictionary changed size during iteration

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================
valeros commented 4 years ago

Hi @tfeldmann ! Looks like the version 3.1.2 was released when PlatformIO didn't have support for Python 3. Could you please try to compile your project using Python 2?