- Notifications
You must be signed in to change notification settings - Fork13.3k
Tools - mkbuildoptglobals refactoring & attempt to fix caching#9249
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
mcspr wants to merge22 commits intoesp8266:masterChoose a base branch frommcspr:buildopts/refactoring
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+1,986 −1,209
Open
Changes from1 commit
Commits
Show all changes
22 commits Select commitHold shift + click to select a range
8253d94 Tools - mkbuildoptglobals refactoring & attempt to fix caching
mcspr8cdc906 compile args typo
mcspreac15af build_out & no explicit clean
mcspr60689bc drop partial data, handle missing closing comment
mcspr9be7e67 check cache state dir state in ci
mcsprc3b64a2 missing file
mcspra527244 typo, fix err trap for "test ...something..."
mcsprfe3102f mention indirect and direct dependency on globals .h contents
mcsprd72ca55 update doc
mcspr35c6221 update docs
mcsprd1c9c7b restore command-line opts info, newlined debugging
mcspra3f9218 mkdir parent when writing
mcspr56bac44 useless from None
mcspreb1a542 multiple quoting fixes from sc & naming
mcspra9afc33 spacing
mcspra91da86 $cache_dir & $root quoting
mcspr7f06e65 debug flag passed as fqbn
mcspr664e9d8 direct types
mcspr78380e8 warnings fix v2, propogate errors instead
mcspr2e63e3e debugging in ci tool checks
mcspre023926 invalid debug lvl=
mcspr0c67f33 rebase unused var
mcsprFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
check cache state dir state in ci
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit9be7e67d338d89bcdceec4fb5b31da529b7946a1
There are no files selected for viewing
3 changes: 3 additions & 0 deletions.github/workflows/build-ide.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
38 changes: 1 addition & 37 deletionstests/build.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletionstests/install_arduino.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/usr/bin/env bash | ||
| set -x | ||
| root=$(git rev-parse --show-toplevel) | ||
| source "$root/tests/env.sh" | ||
| install_arduino "$ESP8266_ARDUINO_DEBUG" |
112 changes: 112 additions & 0 deletionstests/test_mkbuildoptglobals.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| #!/usr/bin/env bash | ||
| root=$(git rev-parse --show-toplevel) | ||
| source "$root/tests/env.sh" | ||
| unset -f step_summary | ||
| function step_summary() | ||
| { | ||
| echo "" | ||
| } | ||
| export ARDUINO_BUILD_CACHE_PATH="$cache_dir" | ||
| sketches="${cache_dir}/sketches/" | ||
| cores="${cache_dir}/cores/" | ||
| esp8266_dir="${ESP8266_ARDUINO_BUILD_DIR}" | ||
| commonfileh="${esp8266_dir}/cores/esp8266/CommonHFile.h" | ||
| tests_dir="$root/tests/test_mkbuildoptglobals" | ||
| tests=$(ls -1 "$tests_dir" | sed 's/.sh$//g') | ||
| function name_size_mtime() | ||
| { | ||
| stat --printf '%n:%s:%Y' "$1" | ||
| } | ||
| function most_recent_file() | ||
| { | ||
| local name="$1" | ||
| local location="$2" | ||
| echo $(readlink -f "${location}/"$(ls -t1 "${location}" | grep "$name" | head -1)) | ||
| } | ||
| function most_recent_dir() | ||
| { | ||
| local location="$1" | ||
| echo $(readlink -f "${location}/"$(ls -t1 "$location" | head -1)) | ||
| } | ||
| function assert_build() | ||
| { | ||
| local name="$1" | ||
| local build_dir="$2" | ||
| local size_check="${3:-0}" | ||
| local build_opt="$build_dir"/sketch/build.opt | ||
| test -e "$build_opt" | ||
| local globals_h="$build_dir"/${name}.ino.globals.h | ||
| test -e "$globals_h" | ||
| if [ "$size_check" = "1" ] ; then | ||
| test -s "$build_opt" | ||
| test -s "$globals_h" | ||
| fi | ||
| } | ||
| function assert_core() | ||
| { | ||
| local size_check="$1" | ||
| if [ "$size_check" = "1" ] ; then | ||
| test -s "$commonfileh" | ||
| else | ||
| test ! -s "$commonfileh" | ||
| fi | ||
| } | ||
| function build_esp8266_example() | ||
| { | ||
| local name="$1" | ||
| ESP8266_ARDUINO_SKETCHES="$root/libraries/esp8266/examples/${name}/${name}.ino" | ||
| build_sketches_with_arduino "$ESP8266_ARDUINO_LWIP" "$mod" "$rem" "$cnt" | ||
| } | ||
| function make_commonh_stat() | ||
| { | ||
| local stat=$(name_size_mtime "$commonfileh") | ||
| test -n "$stat" | ||
| echo "$stat" | ||
| } | ||
| function make_core_stat() | ||
| { | ||
| local recent_core=$(most_recent_dir "$cores") | ||
| local recent_file=$(most_recent_file "core.a" "$recent_core") | ||
| local stat=$(name_size_mtime "$recent_file") | ||
| test -n "$stat" | ||
| echo "$stat" | ||
| } | ||
| case "${1:-}" in | ||
| "list") | ||
| printf "%s\n" $tests | ||
| ;; | ||
| "run") | ||
| for test in $tests ; do | ||
| printf "Checking \"%s\"\n" "$test" | ||
| /usr/bin/env bash $root/tests/test_mkbuildoptglobals.sh $test | ||
| done | ||
| ;; | ||
| *) | ||
| source "$tests_dir/${1}.sh" | ||
| ;; | ||
| esac |
25 changes: 25 additions & 0 deletionstests/test_mkbuildoptglobals/buildopt_then_buildopt.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| function buildopt_then_buildopt() | ||
| { | ||
| build_esp8266_example "GlobalBuildOptions" | ||
| local last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "GlobalBuildOptions" "$last_sketch" 1 | ||
| assert_core 1 | ||
| local globalbuildoptions_commonh_stat=$(make_commonh_stat) | ||
| local globalbuildoptions_core_stat=$(make_core_stat) | ||
| build_esp8266_example "HwdtStackDump" | ||
| last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "HwdtStackDump" "$last_sketch" 1 | ||
| assert_core 1 | ||
| local hwdtstackdump_commonh_stat=$(make_commonh_stat) | ||
| local hwdtstackdump_core_stat=$(make_core_stat) | ||
| test "$hwdtstackdump_commonh_stat" != "$globalbuildoptions_commonh_stat" | ||
| test "$hwdtstackdump_core_stat" != "$globalbuildoptions_core_stat" | ||
| } | ||
| buildopt_then_buildopt |
25 changes: 25 additions & 0 deletionstests/test_mkbuildoptglobals/buildopt_then_nobuildopt.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| function buildopt_then_nobuildopt() | ||
| { | ||
| build_esp8266_example "GlobalBuildOptions" | ||
| local last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "GlobalBuildOptions" "$last_sketch" 1 | ||
| assert_core 1 | ||
| local globalbuildoptions_commonh_stat=$(make_commonh_stat) | ||
| local globalbuildoptions_core_stat=$(make_core_stat) | ||
| build_esp8266_example "Blink" | ||
| last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "Blink" "$last_sketch" 0 | ||
| assert_core 0 | ||
| local blink_commonh_stat=$(make_commonh_stat) | ||
| local blink_core_stat=$(make_core_stat) | ||
| test "$globalbuildoptions_commonh_stat" != "$blink_commonh_stat" | ||
| test "$globalbuildoptions_core_stat" != "$blink_core_stat" | ||
| } | ||
| buildopt_then_nobuildopt |
25 changes: 25 additions & 0 deletionstests/test_mkbuildoptglobals/nobuildopt.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| function nobuildopt() | ||
| { | ||
| build_esp8266_example "Blink" | ||
| local last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "Blink.ino" "$last_sketch" 0 | ||
| assert_core 0 | ||
| local blink_commonh_stat=$(make_commonh_stat) | ||
| local blink_core_stat=$(make_core_stat) | ||
| build_esp8266_example "TestEspApi" | ||
| last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "TestEspApi" "$last_sketch" 0 | ||
| assert_core 0 | ||
| local testespapi_commonh_stat=$(make_commonh_stat) | ||
| local testespapi_core_stat=$(make_core_stat) | ||
| test "$blink_commonh_stat" = "$testespapi_commonh_stat" | ||
| test "$blink_core_stat" = "$testespapi_core_stat" | ||
| } | ||
| nobuildopt |
25 changes: 25 additions & 0 deletionstests/test_mkbuildoptglobals/nobuildopt_then_buildopt.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| function nobuildopt_then_buildopt() | ||
| { | ||
| build_esp8266_example "Blink" | ||
| local last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "Blink" "$last_sketch" 0 | ||
| assert_core 0 | ||
| local blink_commonh_stat=$(make_commonh_stat) | ||
| local blink_core_stat=$(make_core_stat) | ||
| build_esp8266_example "HwdtStackDump" | ||
| last_sketch=$(most_recent_dir "$sketches") | ||
| assert_build "HwdtStackDump" "$last_sketch" 1 | ||
| assert_core 1 | ||
| local hwdtstackdump_commonh_stat=$(make_commonh_stat) | ||
| local hwdtstackdump_core_stat=$(make_core_stat) | ||
| test "$hwdtstackdump_commonh_stat" != "$blink_commonh_stat" | ||
| test "$hwdtstackdump_core_stat" != "$blink_core_stat" | ||
| } | ||
| nobuildopt_then_buildopt |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.