Skip to content

docs: design proposal for user-overridable ESP sdkconfig#472

Merged
zackees merged 1 commit into
mainfrom
docs/sdkconfig-design
Jun 7, 2026
Merged

docs: design proposal for user-overridable ESP sdkconfig#472
zackees merged 1 commit into
mainfrom
docs/sdkconfig-design

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Jun 7, 2026

Summary

Design proposal capturing how a fbuild user should be able to override
ESP-IDF `CONFIG_*` settings without rebuilding the framework, what
surfaces should exist, and how they layer.

No code change. Just `docs/sdkconfig.md` (288 lines) plus an
INDEX.md row and a docs/CLAUDE.md cross-link.

What's proposed

A 5-layer precedence chain (lowest → highest):

  1. Framework pre-baked `sdkconfig.h` (baseline, current behavior)
  2. `fbuild.toml` `[sdkconfig]` table (future fbuild-native config)
  3. `sdkconfig.fragment` in project root (recommended primary surface, Kconfig syntax)
  4. `platformio.ini` `board_build.esp-idf.sdkconfig_options` (PIO compat)
  5. `platformio.ini` `build_flags = -D CONFIG_*` (highest, existing PIO compat)

Merged dict emits as `-D CONFIG_*` flags (correctness) AND as a
synthesized debug `.fbuild/build//sdkconfig.h`
(visibility, not
on the include path).

The current 4-key `SdkConfigSummary` boolean parser becomes a thin
wrapper around the expanded `SdkConfig` dict — no behavior change for
the existing `.eh_frame` policy consumer.

What it explicitly rejects

  • User-owned `sdkconfig.h` in project tree (footgun: framework header
    has hundreds of keys, partial override → undefined behavior)
  • "Just expose build_flags = -D and call it done" (pollutes .ini, no
    Kconfig copy-paste path, no provenance, no fbuild.toml migration
    story)

Open questions (called out in doc)

  1. Fragment filename: `sdkconfig.fragment` vs `.local` vs `.user`
  2. Per-environment fragments (`sdkconfig..fragment`)?
  3. Unknown-key diagnostics — warn or stay silent for forward-compat?
  4. Cache invalidation surface for the synth header fingerprint

Test plan

  • No code change → no tests required
  • INDEX.md picks up the new doc (3 new FAQ rows)
  • docs/CLAUDE.md cross-link added in the "Other docs" list

🤖 Generated with Claude Code

Captures the 5-layer precedence chain (framework default → fbuild.toml
→ sdkconfig.fragment → platformio.ini sdkconfig_options → build_flags
-D CONFIG_*), the two output forms (-D flags on the compile line +
synthesized debug header in the build dir), the concrete API shape
expanding the current 4-key `SdkConfigSummary` into a full `SdkConfig`
dict with provenance tracking, and the open questions to nail down
before implementation (fragment filename, per-env fragments, unknown-
key diagnostics, cache invalidation).

Status: design proposal — not yet implemented.

Index + LLM-guide cross-links added; flat docs/ convention preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 7, 2026

Warning

Review limit reached

@zackees, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 814b518b-ad5b-4ffb-8455-ad54f6d695d7

📥 Commits

Reviewing files that changed from the base of the PR and between 357629c and 8b11efc.

📒 Files selected for processing (3)
  • docs/CLAUDE.md
  • docs/INDEX.md
  • docs/sdkconfig.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/sdkconfig-design

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees zackees merged commit 6dcb3ae into main Jun 7, 2026
83 of 87 checks passed
@zackees zackees deleted the docs/sdkconfig-design branch June 7, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant