Skip to content

Split crypto stdlib modules - #1808

Merged
TheHypnoo merged 5 commits into
mainfrom
feat/split-crypto-webcrypto
May 25, 2026
Merged

Split crypto stdlib modules#1808
TheHypnoo merged 5 commits into
mainfrom
feat/split-crypto-webcrypto

Conversation

@TheHypnoo

@TheHypnoo TheHypnoo commented May 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Split crates/perry-stdlib/src/crypto.rs into smaller topical Rust submodules under crates/perry-stdlib/src/crypto/.
  • Split crates/perry-stdlib/src/webcrypto.rs into smaller topical Rust submodules under crates/perry-stdlib/src/webcrypto/.
  • Removed both stdlib crypto entry files from the file-size allowlist.

Notes

This keeps the existing public crypto and webcrypto module surfaces intact: the top-level entry files now declare real sibling modules, import pub(super) helpers privately for cross-shard use, and publicly re-export the FFI entry points / public handles from the topical shards.

The former include! approach was replaced in this PR, so the split now follows the file-size script guidance more closely: each shard is a real Rust module with its own namespace and compilation unit while preserving the existing #[no_mangle] FFI symbols and parent-module re-export surface.

util.rs in each tree owns the shared imports, helpers, and private types; those are intentionally visible only to sibling shards through the parent module.

Closes #1435.

Validation

  • ./scripts/check_file_size.sh
  • cargo fmt --check
  • cargo check -p perry-stdlib
  • cargo build --release -p perry-stdlib

@TheHypnoo
TheHypnoo marked this pull request as ready for review May 25, 2026 18:10
@TheHypnoo
TheHypnoo merged commit 215d3d0 into main May 25, 2026
10 checks passed
@TheHypnoo
TheHypnoo deleted the feat/split-crypto-webcrypto branch May 25, 2026 18:19
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.

perry-stdlib: split crypto.rs and webcrypto.rs into per-algorithm submodules

1 participant