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

Build with platformio 4 #1805

Merged
merged 10 commits into from
Jul 10, 2019
Merged

Build with platformio 4 #1805

merged 10 commits into from
Jul 10, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Jun 30, 2019

cc @Niek , can you please try the ESPURNA_PIO_SHARED_LIBRARIES=1 stuff?

  • use generic env section
  • all envs are streamlined to just board=... and build_flags=...
  • travis does not use py3 (yet, but i wonder if we can just use py3 syntax straight away)
    and references current rc1 commit platformio/platformio-core@8d459d8, since there is no pre-release on pypi

nightly builder can then verify that every env builder works, at least dumb mistakes like flash size would be caught

- update filepaths: pioenvs -> pio/build
- modify envs to use common settings
- enable shared libs in travis and ota scripts
@Niek
Copy link
Contributor

Niek commented Jul 1, 2019

I like the massive platformio.ini cleanup :) Building with ESPURNA_PIO_SHARED_LIBRARIES=1 works fine, but the shared_libdeps_dir (code/libraries) is not in the .gitignore - you might want to add that.

@mcspr
Copy link
Collaborator Author

mcspr commented Jul 2, 2019

PR & documentation:
platformio/platformio-core#1643
http://docs.platformio.org/en/latest/projectconf/section_env.html#global-scope-env

Will update .gitignore

Previous .piolibdeps catching looks iffy too, probably it should use global storage based on travis env (~/.platformio/lib)
I also wonder if there's any problem always having shared libraries/ dir enabled

@Niek
Copy link
Contributor

Niek commented Jul 5, 2019

I'm not sure if it's a bug in PIO (4.0-rc4) or related to this PR, but I noticed building with a core different than 2.4.x I get this error:

TypeError: expected string or buffer:
  File "~/.platformio/penv/lib/python2.7/site-packages/platformio/builder/main.py", line 126:
    env.SConscript("$BUILD_SCRIPT")
  File "~/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 541:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/~/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 250:
    exec _file_ in call_stack[-1].globals
  File "~/.platformio/platforms/espressif8266/builder/main.py", line 255:
    env.get("UPLOAD_PORT", ""))):
  File "~/.platformio/penv/lib/python2.7/re.py", line 141:
    return _compile(pattern, flags).match(string)

@mcspr
Copy link
Collaborator Author

mcspr commented Jul 5, 2019

Is this using -ota env and platform = espressif8266@2.2.2, with defined ESPURNA_IP & ESPURNA_AUTH (if yes, what is ESPURNA_IP value)?
What is env.get("UPLOAD_PORT") value? You can use print(), somewhere before that failing re.match call.

@Niek
Copy link
Contributor

Niek commented Jul 5, 2019

Yes, @2.2.2 and -ota - but I just noticed I forgot to update my env from common.upload_port to common.ota_upload_port, my bad. However, after fixing this the error becomes (same with non-ota envs):

KeyError: 'FRAMEWORK_ARDUINOESP8266_DIR':
  File "~/.platformio/penv/lib/python2.7/site-packages/platformio/builder/main.py", line 134:
    env.SConscript(item, exports="env")
  File "~/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 541:
    return _SConscript(self.fs, *files, **subst_kw)
  File "~/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 250:
    exec _file_ in call_stack[-1].globals
  File "~/Documents/Code/twine-firmware/code/extra_scripts.py", line 145:
    patch_lwip()
  File "~/Documents/Code/twine-firmware/code/extra_scripts.py", line 100:
    framework_dir = env["FRAMEWORK_ARDUINOESP8266_DIR"]
  File "~/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 410:
    return self._dict[key]

Maybe this env var is no longer set in 2.2.2?

@Niek
Copy link
Contributor

Niek commented Jul 5, 2019

This fixed it for me (in extra_scripts.py):

framework_dir = platform.get_package_dir("framework-arduinoespressif8266")

I tested and this works in 2.3.0 up to including 2.5.2.

@mcspr mcspr merged commit 1d133be into xoseperez:dev Jul 10, 2019
@mcspr mcspr deleted the build/platformio-4 branch July 10, 2019 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants