Skip to content

feat(prebuilt): stamp the arduino-esp32 SDK variant identity in staging (#1882) - #2164

Merged
zackees merged 1 commit into
mainfrom
agent/1882-sdk-stamp
Nov 23, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/1882-sdk-stamp

Conversation

@zackees

@zackees zackees commented Nov 23, 2026

Copy link
Copy Markdown
Member

Decision 8a of docs/design/artifact-serving-decisions.md — the second of the three
component stamps, and the "patch sites moved ahead of the stamp" unit that decision 8a
requires. Follows #2162 (core stamp + the component_id machinery); #1882 stays open.

What changes

libs.rs — the SDK variant's identity is taken in the extract dir, ahead of the merge.

  • install_sdk_from_archive (new, sync) is the staging half of the SDK install: extract →
    find the <variant>/ tree wherever the producer's wrapper put it → run
    patch_mcu_compatibility there → content_id over that staging tree →
    write_stamp (sdk-<variant>, SDK_RECIPE = 1) → merge into tools/.
    install_sdk_archive keeps only the fetch + temp-dir ownership.
  • Patch-before-stamp. patch_mcu_compatibility used to mutate the installed tree
    after the merge; it now runs in staging so the patches are inside the hash. SDK_RECIPE
    is 1 from the start of this unit, and bumps whenever the patches change what they write.
  • reconcile_sdk_stamp. A stamp promises that these exact bytes were hashed, and the
    merged tree is what ships. After the merge the id is recomputed over
    tools/esp32-arduino-libs/<variant>/ and the stamp is withdrawn if the two disagree
    (a pre-existing partial tree, or a copy that did not reproduce a link). No identity is
    better than a false one: the planner then compiles from source.
  • patch_installed_variants skips a stamped variant. A stamped component is final —
    decision 8a forbids mutating it after the stamp. A legacy tree (installed before this
    landed) still gets patched in place and keeps no identity; there is no backfill.
  • component_id::remove_stamp — the withdrawal primitive, idempotent.
  • esp32_framework/README.md documents the new responsibility of libs.rs.

Deliberately conservative

  • A whole-bundle libs archive stamps only the requested variant. Sibling variants
    merged in the same pass keep no identity, so they compile from source instead of being
    certified unpatched. Stamping all of them is a later unit.
  • The MCU skeleton stamp (8a's third row) is not in this PR.
  • The FetchRequest::fetch half of ensure_libs is not exercised by the new tests — they
    drive install_sdk_from_archive, which is the whole extract/patch/stamp/merge/reconcile
    path, with a real tar.xz fixture. A real download remains an ignored-e2e cell (feat(espidf): move the delegated ESP-IDF pin to v5.5.2+ so ESP32-P4 rev-3 silicon builds #2133).

Verification (real output)

  • soldr cargo test -p fbuild-packages-fetch --lib → 300 passed; 0 failed; 2 ignored
    (299 before; +1 for remove_stamp).
  • soldr cargo test -p fbuild-library --lib → 389 passed; 0 failed; 9 ignored,
    including the five new tests:
    • a_fresh_sdk_install_stamps_the_variant_in_staging — stamp exists with
      component = sdk-esp32c3, version, recipe, and content_id equal to the id of the
      merged tree.
    • sdk_compat_patches_run_ahead_of_the_stamp — for esp32c2 both compat mutations are
      present in the installed tree and inside the id.
    • a_merge_into_a_preexisting_tree_drops_the_identity — an extra liblegacy.a survives
      the merge and the stamp is withdrawn.
    • a_stamped_variant_is_never_patched_again / an_unstamped_variant_is_still_patched_in_place.
  • soldr cargo clippy -p fbuild-library -p fbuild-packages-fetch --all-targets -- -D warnings
    → exit 0. soldr cargo fmt --all -- --check → exit 0.
  • ci/enforce_platform_boundary.py --print-totals → rows=0; dylint_rows=0;
    ci.test_enforce_platform_boundary → 14 tests OK.

#1882 stays open (remaining units: the MCU skeleton stamp, the hidden --prebuilt-core
opt-in, the 8b ladder). Per decision 8c nothing is published or fetched by this change.

…ng (#1882)

Decision 8a: the SDK variant's content id is taken in the extract dir, after the compat patches and before the merge; the merge re-checks the id and withdraws the stamp when it did not reproduce the staged bytes. patch_installed_variants skips a stamped (final) variant and still patches legacy trees, which keep no identity. Adds component_id::remove_stamp.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant