Skip to content

chore(deps): pull portable-atomic only where it is reachable - #18

Merged
Ttimmahlax merged 1 commit into
mainfrom
chore/portable-atomic-optional
Sep 8, 2026
Merged

chore(deps): pull portable-atomic only where it is reachable#18
Ttimmahlax merged 1 commit into
mainfrom
chore/portable-atomic-optional

Conversation

@Ttimmahlax

Copy link
Copy Markdown
Contributor

A firmware was fetching and compiling portable-atomic and then discarding it at link time.

Its only use site is gated all(not(target_has_atomic = "64"), feature = "std") — a no_std build uses options::split64 instead — but the dependency was declared for the target regardless of the feature. It is now optional and enabled by std.

target in the graph
riscv32imac with std 1 — the case that needs it
riscv32imac no_std 0 (was 1, and 20 build artifacts)
x86_64-pc-windows-msvc 0 — target section never matches

This buys an accurate dependency graph, not bytes. It already cost nothing on the device: after split64 landed, portable_atomic symbols in a shipped ESP32 image went to zero and its 4,288-byte LOCKS table left the symbol map. But an unused crate still shows up in an SBOM, a cargo audit, and every dependency count a firmware reviewer looks at.

No version bump — this rides with the next release rather than spending a 2.0.1 on tidiness.

Gates: 109/33 default, 90/19 small profile, clippy on three configs, both RISC-V targets at both geometries, rusty_alloc-api no_std, wasm32, unsafe census, gate selftest 5/5, wasm size ratchet. Downstream corpus unchanged.

🤖 Generated with Claude Code

A firmware was fetching and compiling `portable-atomic` and then discarding it
at link time. Its only use site is gated
`all(not(target_has_atomic = "64"), feature = "std")` -- a `no_std` build uses
`options::split64` instead -- but the dependency was declared for the target
regardless of the feature.

It is now `optional` and enabled by `std`, so it appears exactly where it is
used. Verified on three shapes:

  riscv32imac WITH std      1 in the graph   (the case that needs it)
  riscv32imac no_std        0                (was 1, and 20 build artifacts)
  x86_64 windows            0                (target section never matches)

Costs nothing on the device either way -- after `split64` landed, its symbols in
a shipped ESP32 image went to zero and its 4,288-byte `LOCKS` table left the
symbol map -- so this buys an accurate dependency graph rather than bytes. An
unused crate still shows up in an SBOM, a `cargo audit`, and every dependency
count a firmware reviewer looks at.

No version bump here: this rides with the next release rather than spending a
2.0.1 on tidiness.

Gates: 109/33 default, 90/19 small profile, clippy on three configs, both
RISC-V targets at both geometries, rusty_alloc-api no_std, wasm32, unsafe
census, gate selftest 5/5, wasm size ratchet. Downstream corpus unchanged --
spacedb-sdk (plain and secure), rusty_alloc_default and rusty_zstd all green;
rusty_maplibre still on its documented `features = ["std"]` migration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Ttimmahlax
Ttimmahlax merged commit cdb6c93 into main Sep 8, 2026
9 of 12 checks passed
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.

2 participants