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

PIO: fix env definitions (again) #2212

Merged
merged 16 commits into from
Apr 7, 2020
Merged

PIO: fix env definitions (again) #2212

merged 16 commits into from
Apr 7, 2020

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Apr 6, 2020

2nd try for #2099
Resolve #2197

Move base envs to the same model as travis-{2_3_0,latest,git}:

  • define env that sets platform, framework and build flags
  • define 1m, 2m and 4m per each env
  • every hw env sets extends = esp8266-{,latest,git}-SIZE-base instead of build_flags = ${common.build_flags_SIZE}

Additionally:

  • remove esp8266-...-ota, Docs need adjustments
  • remove every platform but 1.5.0 and 'latest', prepare to deprecate 1.5.0

Since we can't don't know how to force PIO to respect our wishes to not destroy build directory when our settings change or we add / remove files to project directory. Or, have any way of caching intermediate files that have the same source+build_flags but different env: https://community.platformio.org/t/build-cache-dir-will-not-share-object-files-between-envs/10011

So, instead, adjust build script to use another script that compiles env list into a compatible pio run calls that will re-use environment .o files cutting build time in half:
https://travis-ci.com/github/mcspr/espurna/builds/158421380 (~12-14min)
https://travis-ci.org/github/xoseperez/espurna/builds/631168730 (~27-28min)
But this forces us to use a very strict structure in .ini

TODO:

  • I'll try to find another way of merging build_flags variables (or use the same mechanism as pio does + filter through uniq(). may even using pio config class directly, but we will depend on sort-of private api and we don't depend on a specific version)
  • base-esp8266-1m-latest? esp8266-1m-latest-base?
  • (?) instead of creating shell script, call pio run right in the python script

(
NOTE:
There is another approach that patches platformio internals at runtime:
https://github.com/esphome/esphome/blob/dev/esphome/platformio_api.py
Not sure I want to do that
)

@mcspr mcspr merged commit db50be9 into xoseperez:dev Apr 7, 2020
@mcspr mcspr deleted the pio/envs branch April 7, 2020 18:20
mcspr added a commit to mcspr/espurna-nightly-builder that referenced this pull request Apr 7, 2020
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.

PIO: feature/stage gone, git environment would not build
1 participant