tronxy3d / Gemini

GNU General Public License v3.0
4 stars 4 forks source link

RuntimeError: deque mutated during iteration #3

Open Q07707 opened 1 year ago

Q07707 commented 1 year ago

Why does it appear during compilation

1684917049278
Elchschmied commented 1 year ago

I have same issue and this version does not create firmware file.

Building in release mode RuntimeError: deque mutated during iteration: File "/home/codespace/.platformio/penv/lib/python3.10/site-packages/platformio/builder/main.py", line 182: env.SConscript(env.GetExtraScripts("post"), exports="env") File "/home/codespace/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598: return _SConscript(self.fs, *files, **subst_kw) File "/home/codespace/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285: exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) File "/workspaces/Gemini/buildroot/share/PlatformIO/scripts/tronxy_scrypt.py", line 8: marlin.relocate_vtab(board.get('build.offset')) File "/workspaces/Gemini/buildroot/share/PlatformIO/scripts/marlin.py", line 30: replace_define("VECT_TAB_OFFSET", address) File "/workspaces/Gemini/buildroot/share/PlatformIO/scripts/marlin.py", line 19: for define in env['CPPDEFINES']:

spaelectronics commented 10 months ago

I'm having the same issue. Is there any fix for this?

zeluisping commented 2 weeks ago

Fix for this is the following, open the last file where env['CPPDEFINES'] is (last file on the error) and add .copy() right after.

Before:

def replace_define(field, value):
    for define in env['CPPDEFINES']:
        if define[0] == field:
            env['CPPDEFINES'].remove(define)
    env['CPPDEFINES'].append((field, value))

After:

def replace_define(field, value):
    for define in env['CPPDEFINES'].copy():
        if define[0] == field:
            env['CPPDEFINES'].remove(define)
    env['CPPDEFINES'].append((field, value))