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

AttributeError: 'SConsEnvironment' object has no attribute 'AddPlatformTarget' #4

Closed
martinjaeger opened this issue Jul 7, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@martinjaeger
Copy link

Hello @valeros,

Thanks for updating PlatformIO to Zephyr 2.3!

I get the following error:

AttributeError: 'SConsEnvironment' object has no attribute 'AddPlatformTarget':
  File "/home/martin/.platformio/penv/lib/python3.8/site-packages/platformio/builder/main.py", line 168:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/martin/.platformio/platforms/ststm32/builder/main.py", line 98:
    target_elf = env.BuildProgram()
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/home/martin/.platformio/packages/framework-zephyr/scripts/platformio/platformio-build-pre.py", line 29:
    env.ProcessProgramDeps()
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/home/martin/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/platformio.py", line 118:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/home/martin/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/platformio.py", line 330:
    SConscript(env.GetFrameworkScript(f), exports="env")
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 660:
    return method(*args, **kw)
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/martin/.platformio/platforms/ststm32/builder/frameworks/zephyr.py", line 28:
    SConscript(
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 660:
    return method(*args, **kw)
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/martin/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/martin/.platformio/packages/framework-zephyr/scripts/platformio/platformio-build.py", line 1077:
    env.AddPlatformTarget("menuconfig", None, [env.VerboseAction(

If I comment out the menuconfig line here it builds fine.

Further information:

@martinjaeger martinjaeger added the bug Something isn't working label Jul 7, 2020
@valeros
Copy link
Member

valeros commented Jul 7, 2020

Hi @martinjaeger ! Could you please try the latest PlatformIO core? Just run pio upgrade --dev. Thanks!

@martinjaeger
Copy link
Author

It works after pio upgrade --dev. Thanks for the hint.

Can you explain when I need to use the dev version? Is it always safe to use the dev version or is it considered unstable and I should normally use the "normal" pio version?

@valeros
Copy link
Member

valeros commented Jul 7, 2020

Partially it's my mistake, AddPlatformTarget is a new feature that adds targets from a platform to PlatformIO IDE dynamically. It hasn't been released yet, so I'll publish a hotfix release that will be backward compatible with the current PlatformIO core.

@martinjaeger
Copy link
Author

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants