refactor(compile): split native-manifest parsing out of resolve.rs (unblock lint)#1948
Closed
proggeramlug wants to merge 1 commit into
Closed
refactor(compile): split native-manifest parsing out of resolve.rs (unblock lint)#1948proggeramlug wants to merge 1 commit into
proggeramlug wants to merge 1 commit into
Conversation
resolve.rs had grown to 2168 lines (over the 2000-line file-size CI cap, without an allowlist entry), turning the `lint` gate red on main and on every open PR. Extract the self-contained `perry.nativeLibrary` / `nativeModule` manifest parsing family — `has_perry_native_library`, `has_perry_native_module`, `parse_native_library_manifest` and its ABI / POD / backend / target-config descriptor parsers, the per-arch target-key + prebuilt-path helpers, and `validate_abi_version` — into a new sibling module `resolve/native_manifest.rs`. The symbols are re-exported from `resolve.rs` so all callers keep reaching them via the `resolve::` path; no behavior change. resolve.rs: 2168 -> 851 lines; native_manifest.rs: 1346 lines. Both under the cap. `cargo test -p perry resolve::` (41 tests) passes.
Contributor
Author
|
Closing as redundant — superseded by #1925 ( On current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/perry/src/commands/compile/resolve.rshad grown to 2168 lines, over the 2000-linecheck_file_size.shcap and without an allowlist entry — so thelintrequired gate was red onmainand on every open PR (e.g. #1940). This splits it back under the cap.What changed
Extracts the self-contained native-library manifest parsing family out of
resolve.rsinto a new sibling moduleresolve/native_manifest.rs:has_perry_native_library/has_perry_native_moduleparse_native_library_manifest+ its ABI / POD / backend / target-config descriptor parsersoptional_*/parse_optional_*field helpers, per-arch target-key + prebuilt-path resolutionvalidate_abi_version/PERRY_FFI_ABI_VERSIONThe module/import resolution logic (
resolve_import& friends) andfind_perry_workspace_rootstay inresolve.rs. The moved symbols are re-exported fromresolve.rsso all callers (compile.rs,collect_modules.rs,lock_scan.rs, thenative_librarysibling, and the test module) keep reaching them via theresolve::path.Pure refactor — no behavior change.
Result
resolve.rsresolve/native_manifest.rs./scripts/check_file_size.sh→OK: no Rust source files exceed 2000 lines.cargo build --release -p perry→ greencargo test --release -p perry resolve::→ 41 passed, 0 failedcargo fmt --all -- --check→ clean