Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mcspr wants to merge 22 commits into esp8266:master
base: master
Choose a base branch
Loading
from mcspr:buildopts/refactoring

Conversation

Copy link
Collaborator

@mcspr mcspr commented May 27, 2025
edited
Loading

Optional include for build-dir header to exclude it from core.a when no build opts are created / used. Preventive reads before writes, too
Prefer to use --output-dir in scripts, tests/device must be out-of-tree for caching to work properly (by avoiding changing core nested dirs)

Assume 'aggressive caching' is normal mode of operation, no need for special treatment
(dependencies can be checked by looking at .d files in the build dir)

Even CI uses arduino-cli ~/.cache/arduino/{sketch,core} for building
Allow sketches without globals.h to share core.a, rebuild otherwise (same sketch cache is retained, core.a & .o's reused)

Drop manual logging in favour of 'import logging'. Arduino-CLI might still need tweaks in debug mode, though. Output flushing does not always happen promptly, but using single lines instead of multiple often helps.

Allow multiple entries for the same name, which are then merged.
Allow spaces between @ and the signature words.
Allow to use line right after signature.
Syntax warnings show relevant snippet from globals.h

@mcspr mcspr marked this pull request as ready for review May 28, 2025 20:39
Copy link
Collaborator Author

mcspr commented May 28, 2025
edited
Loading

Also, ping @mhightower83

Main difference is .d dependency. Previously it was both CommonHFile.h & build-path/SKETCH globals.h. Now, it is either one or both. Sketches without globals.h should build as usual, no dependency means core.a is cached and no core files are depending on a different sketch build path every other build

globals.h is also included only when build.opt includes it. Direct dependency on the sketch can be created via #include "SKETCH.ino.globals.h", if it is ever necessary
(for our files, it is not. maybe someone actually uses it 🤷)

I kept previous 'aggressive caching' notes for posterity, since I am not sure how arduino-builder / arduino-cli worked (or did not work) before. Could also just remove it, since none of the notes actually apply to the current version of the script

w/ PR - IDE 1.8.19 works fine, so is CLI 1.2.2 (CI runs it)

mcspr added 20 commits July 2, 2025 01:32
Optional include for build-dir header to exclude it from core.a when no
build opts are created / used. Preventive reads before writes, too
Plus, missing change to makecorever.py doing read before write
Prefer to use --output-dir in scripts, tests/device *must* be
out-of-tree for caching to work properly (avoid changing core nested dirs)
Assume 'aggressive caching' is normal mode of operation, no need for special treatment
(can be checked by looking at .d files in the build dir)
Even CI uses arduino-cli ~/.cache/arduino/{sketch,core} for building
Allow sketches without globals.h to share core.a, rebuild otherwise
(same sketch cache is retained, core.a & .o's reused)
Drop manual logging in favour of 'import logging'. Arduino-CLI might still need
tweaks in debug mode, though. Output flushing does not always happen promptly.
Allow multiple entries for the same name, which are then merged.
Allow spaces between @ and the signature words.
Allow to use line right after signature.
Syntax warnings show relevant snippet from globals.h
bump global build options page in the menu hierarchy
share pydoc blob as rst instead, reference on the main page
note that aggressive caching opts are only for IDE 1.x
@mcspr mcspr force-pushed the buildopts/refactoring branch from 7994b18 to 2e63e3e Compare July 1, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /