Skip to content

chore(warnings): take the workspace from 492 rustc warnings to 0, and gate it#6837

Open
TheHypnoo wants to merge 12 commits into
mainfrom
chore/warnings-sweep-405
Open

chore(warnings): take the workspace from 492 rustc warnings to 0, and gate it#6837
TheHypnoo wants to merge 12 commits into
mainfrom
chore/warnings-sweep-405

Conversation

@TheHypnoo

@TheHypnoo TheHypnoo commented Jul 25, 2026

Copy link
Copy Markdown
Member

What

A clean cargo check --workspace --all-targets on main (8b2c736ed, rustc 1.95.0) emitted 492 warnings. This branch takes that to 0 across four build scopes, and adds a CI job so it stays there.

Lint On main Now
unused_unsafe 150 0
dead_code 121 0
unused_imports 96 0
unreachable_patterns 31 0
non_snake_case 25 0
private_interfaces / private_bounds 20 0
deprecated (objc2) 18 0
function_casts_as_integer 11 0
everything else 20 0

Scopes verified at zero:

cargo check --workspace --all-targets   # minus the cross-host UI crates
cargo check -p perry --bins             # the CI product scope
cargo check -p perry-runtime --no-default-features
cargo check -p perry-runtime -p perry-stdlib -p perry-runtime-static -p perry-stdlib-static

Why now

Nothing gated warnings. lint runs only cargo fmt --check; the clippy job exits non-zero only on deny-level [workspace.lints], runs without --all-targets, and test.yml sets RUSTFLAGS: -Awarnings in one leg. #6639 cleared the imports four days ago and 49 came straight back, from a file split that copied whole import preambles into each new submodule of commands/compile.rs. The last commit here adds a rustc-warnings job — cargo check with -D warnings, two legs.

Three real defects the sweep found

  1. extern "C" declarations for symbols the crate defines itself. perry-ext-http-server/src/handle_dispatch.rs declares js_node_http_res_write and js_node_http_res_end; the definitions are in response.rs. A local declaration of a symbol you also define is never checked against the definition — the class that shipped an ABI mismatch on len: i64 vs u32 in refactor(perry-ui-macos): single canonical extern decls for clashing FFI symbols #6646. Both matched here. The two unused ones are deleted; the other ~62 in that block are used, carry the same hazard, and are tracked separately.
  2. A test that never ran. duplex_allow_half_open_defaults_true_and_honors_false_option had no #[test].
  3. A duplicated GC test seeder. test_seed_class_parent_closure_root existed in both object/class_gc_roots.rs and object/class_registry/gc_roots.rs, both writing the same CLASS_PARENT_CLOSURES static.

Judgment calls

  • unused_unsafe (150). rustc gives no machine-applicable fix, so this was scripted off the diagnostic byte spans. Where the block held only expressions or statements, the block went with the keyword (106). Where it held a top-level let, use, or item, only the keyword went and the braces stayed (44) — splicing those into the enclosing scope widens the binding and can silently re-resolve a later name.
  • dead_code (121). Rebased from the 2026-07-18 triage. No #[no_mangle] function is deleted, so nothing the compiler emits calls to can go missing at link time; the 11 deleted extern "C" items are Rust-internal closure thunks addressed by function pointer, which rustc tracks precisely. GC verifiers, #[cfg(test)] helpers and FFI keepalives are kept with a justified allow. Three sites needed fixing against current main: path::resolve_win32_str is called again by url/node_compat.rs, and two class_field_inline_guard helpers arrived after that triage (perf(runtime): #6759 C5a — per-key vetting for the class-field inline-guard disable #6802).
  • Vacuous glob re-exports (9). pub use child::* where every item in the child is pub(super) re-exports nothing — narrowed each to the visibility it actually has (two pub(crate), six plain use) rather than adding an allow.
  • Reduced feature set (11). perry depends on perry-runtime with default-features = false, so cargo clippy -p perry --bins compiles a runtime with regex-engine, diagnostics and temporal off, where items the workspace check finds live are dead. Each is gated at the item.
  • done in commands/publish is the one warning left suppressed. rustc is right that the store is never read, because the Complete arm breaks immediately — which means the two if done { break } reconnect guards can only ever see false. Whether the flag still buys anything is a protocol question, so the store stays with the allow and a comment.

Not covered

The cross-host UI crates (ios, tvos, watchos, visionos, android, windows, windows-winui, gtk4) cannot be checked from this host and are untouched. perry-ui-macos is fixed here but sits in CI's excluded scope, so the new gate does not cover it on ubuntu.

Verification

  • cargo fmt --all --check, scripts/check_file_size.sh, scripts/addr_class_inventory.py: pass.
  • cargo test --workspace (minus cross-host UI crates): see the CI run.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Promise then/catch/finally handling, including subclass/species behavior.
    • Improved package "exports" resolution by considering multiple candidate paths.
    • Corrected process.umask behavior when the argument is omitted.
    • Improved Node.js mock APIs and expanded native-module callable exports.
    • SQLite connection setup now correctly surfaces limit-configuration failures.
    • Corrected multiple macOS UI/audio/audio playback and URL/stream behaviors.
  • Quality
    • CI now enforces Rust compiler “no warnings” builds to prevent regressions.

…argets

Run `cargo fix --workspace --all-targets` now that the workspace test
targets compile again, so test-only imports are seen instead of pruned.

Clears 87 warnings: 74 unused_imports, 11 function_casts_as_integer (new
in rustc 1.95 — casting a function item straight to an integer), plus one
each of unused_mut and unused_variables.

Two things the tool could not do on its own:
- optimized_libs/tests.rs reached build_missing_prebuilt_ext_lib through
  `super::*`, so cargo fix pruned the re-export it needed. The test now
  imports the function from no_auto directly.
- 49 of the pruned imports were duplicate preambles introduced when
  commands/compile.rs was split into submodules after #6639.
rustc reports these as `unused_unsafe`: the block wraps code that needs no
unsafe context, so the marker hides the sites that do. rustc gives no
machine-applicable fix, so this was scripted off the diagnostic byte spans.

Where the block only held expressions or statements, the block goes with the
keyword. Where it held a top-level `let`, `use`, or item, only the keyword
goes and the braces stay — splicing those into the enclosing scope would
widen the binding and could silently re-resolve a later name. 106 blocks
removed, 44 kept as plain scoping blocks.
handle_dispatch.rs declares `js_node_http_res_write` and
`js_node_http_res_end` in an `extern "C"` block, but perry-ext-http-server
defines both itself (response.rs:1136 and response.rs:1393). Nothing calls
the declarations, so rustc reports them as dead functions.

Both signatures matched their definitions, so the deletion is a no-op at
link time. The other ~62 declarations in that block are used and stay for
now; they carry the same hazard — a local declaration of a symbol you also
define is never checked against the definition, which is how #6646 shipped
an ABI mismatch on `len: i64` vs `u32`. Tracked separately.
Deletes refactor leftovers — helpers, thunks, fields and constants nothing
calls any more. Keeps, with a justified `#[allow(dead_code)]`, the GC
verifiers, the `#[cfg(test)]`-only helpers and the FFI keepalives that exist
to be reachable from generated code rather than from Rust.

No `#[no_mangle]` function is deleted, so no symbol the compiler emits calls
to can go missing at link time. The 11 deleted `extern "C"` items are
Rust-internal closure thunks addressed by function pointer, which rustc
tracks precisely.

Rebased from the triage done on 2026-07-18, so three sites needed fixing
against current main:
- `path::resolve_win32_str` is no longer dead — url/node_compat.rs calls it.
  Restored.
- `class_field_inline_guard_enabled` and `test_reset_class_field_inline_guard`
  arrived after that triage (#6802). Kept.
- The CGContext* declarations in widgets/chart.rs were already removed by
  #6646. Kept removed.
…arnings

Four triaged families, rebased onto current main:

- non_snake_case: the generated `thunk_<module>_<jsName>` wrappers keep the
  JS spelling on purpose, so the allow sits on the three thunk macros and the
  node_submodule thunks rather than on each site. Real Rust names renamed.
- private_interfaces / private_bounds: widen the leaked types to `pub(crate)`
  so the signature matches what callers can already reach.
- unreachable_patterns: 32 duplicate match arms. Each was checked against the
  arm that shadows it — all are literal repeats, none had a different body
  that the first arm was swallowing.
- unreachable_code: two `return js_throw(..)` where `js_throw` returns `!`.
- sqlite `Connection::set_limit` returned a discarded `Result`: propagated
  with `?` in connection.rs, and `let _` in dispatch.rs where the limit id is
  already validated.
- unused_doc_comments: 8 `///` comments on statements, which rustdoc drops.
- Four dead bindings whose right-hand side is pure, so the binding goes
  instead of getting an underscore.

Conflicts against main resolved in favour of main: perry-hir switched to
`crate::types::Type`, and object/mod.rs moved the transition cache into
`RuntimeState`.
- objc2 deprecations: 17 `msg_send!` invocations were missing the comma
  between arguments, plus one `Retained::cast` swapped for the
  `cast_unchecked` the sibling widgets already use.
- Vacuous glob re-exports: `pub use child::*` where every item in the child
  is `pub(super)` re-exports nothing, which is what rustc was reporting.
  Narrowed each to the visibility it actually has — two to `pub(crate)`, six
  to a plain `use` — instead of silencing the lint.
- `native_proof_*` integration tests share one HIR builder toolkit and each
  file drives a subset, so the allow sits on the file with that reason.
- issue_4914_cluster_port_sharing.rs: its only test is gated to non-macOS
  unix; the helpers and imports now carry the same gate.
- `duplex_allow_half_open_defaults_true_and_honors_false_option` had no
  `#[test]`, so it had never run. Added.
- `test_seed_class_parent_closure_root` existed twice, both writing the same
  `CLASS_PARENT_CLOSURES` static. Deleted the unreachable copy.
- `WIDE_KEY_INDEX_CAPACITY` is a leftover of the 4-entry LRU that #6759 C1
  replaced with shape records.
- crash_log.rs took a shared reference to a `static mut` inside a signal
  handler; now `&raw const`.
- Two dead stores removed (`idx`, `adjusted_args_storage`). The third,
  `done` in publish, is kept with a comment: rustc is right that the store
  is never read, and that means the reconnect guard it feeds can never fire
  — a protocol question, not a lint one.
- Four test names de-camel-cased, one duplicated `#[test]` removed.

`cargo check --workspace --all-targets` now reports zero warnings for the
host-compatible scope. The cross-host UI crates (ios/tvos/watchos/visionos/
android/windows/gtk4) cannot be checked from macOS and are untouched.
`perry` depends on perry-runtime with `default-features = false`, so
`cargo clippy -p perry --bins` — the product leg in CI — compiles a runtime
where regex-engine, diagnostics and temporal are off. Eleven items are live
under the workspace feature set and dead under that one, and the workspace
check never saw them.

Each is now gated at the item rather than silenced:
- `array_named_props_install_fresh` and `regex::utf16::utf16_index_to_byte`
  are called only from regex-engine modules; both, and the array re-export,
  carry that feature (the cross-gate shape regex/utf16.rs already documents).
- Four `fs::dir_glob_watch::glob` imports serve regex-engine-gated code and
  now match the `PathBuf` import next to them.
- The two `AllocatorMaintenance*` enums and `TemporalLocaleCtx` are built
  from `diagnostics` and `temporal` code respectively, so the allow applies
  only when that feature is off.
- publish's `done` allow moved to the function: a statement-level attribute
  does not affect `unused_assignments`.

Four scopes now report zero warnings: `--workspace --all-targets`,
`-p perry --bins`, `-p perry-runtime --no-default-features`, and
`-p perry-runtime -p perry-stdlib -p perry-runtime-static -p perry-stdlib-static`.
Nothing stopped a PR from adding a warning: `lint` runs only
`cargo fmt --check`, and `clippy` exits non-zero only on the deny-level lints
in `[workspace.lints]`. The 96 unused imports this branch removed include 49
that reappeared within four days of #6639, from a file split that copied whole
import preambles into each new submodule — the gate is what stops that.

Two legs, because they compile different code. `perry` depends on
perry-runtime with `default-features = false`, so the product leg sees a
runtime with regex-engine, diagnostics and temporal off. The workspace leg
passes `--all-targets` so test and bench targets count.

Separate from the clippy job on purpose: clippy's warn-level lints stay
informational, rustc's do not. perry-ui-macos sits in the excluded scope
(this runs on ubuntu), so its warnings are not gated here.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d2405940-c766-4a82-8d97-2f8bff9e0507

📥 Commits

Reviewing files that changed from the base of the PR and between b402ec6 and b2825cb.

📒 Files selected for processing (3)
  • crates/perry-runtime/src/fs/mod.rs
  • crates/perry/src/commands/compile/link/platform_cmd.rs
  • crates/perry/src/commands/mod.rs
💤 Files with no reviewable changes (1)
  • crates/perry-runtime/src/fs/mod.rs

📝 Walkthrough

Walkthrough

The PR reduces Rust compiler warnings across the workspace, adds a rustc-warnings CI gate using cargo check -D warnings, removes unused code and imports, narrows internal visibility, adds feature/lint gating, and updates selected runtime, native-module, standard-library, and macOS integrations.

Changes

Rust warning enforcement and cleanup

Layer / File(s) Summary
CI warning gate
.github/workflows/test.yml, changelog.d/*
Adds product and host-compatible cargo check jobs with RUSTFLAGS=-D warnings and documents the warning reduction.
Compiler and HIR cleanup
crates/perry-codegen/**, crates/perry-hir/**, crates/perry/src/commands/compile/**
Removes obsolete helpers and imports, simplifies traversal and resolution logic, adjusts internal visibility, and updates typed-signature handling.
Runtime cleanup and gating
crates/perry-runtime/**
Removes redundant unsafe scopes and unused helpers, adds feature/dead-code gates, narrows re-exports, and updates selected runtime dispatch paths.
Promise, stream, and native-module behavior
crates/perry-runtime/src/promise/**, node_stream*, object/native_module/**
Reworks Promise prototype dispatch, stream abort handling, callable export mappings, native-module enumeration, and selected dispatch behavior.
Standard-library and platform integrations
crates/perry-stdlib/**, crates/perry-ui-macos/**
Cleans up safety boundaries and imports, corrects Objective-C message syntax, adjusts platform state and retained fields, and updates selected error handling.
Validation and test maintenance
crates/**/tests/**, crates/perry/tests/**
Renames tests, restores a missing test attribute, removes orphaned annotations, and gates platform-specific test helpers.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: ready

Suggested reviewers: proggeramlug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: eliminating rustc warnings and adding a CI gate.
Description check ✅ Passed It covers the main summary, change details, risks, and verification, though it doesn’t follow the repo’s exact section headings.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/warnings-sweep-405

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.

CI runs `dtolnay/rust-toolchain@stable`, which is 1.97.1 on the runners; the
local default stable here is 1.97.1's predecessor, 1.95.0, which does not have
this lint yet. `length(1.0)` in the TUI layout pass inferred `f32` by fallback
rather than by the `From<f64>` bound, which rustc is phasing out
(rust-lang/rust#154024). Spelling the literal `1.0_f32` says what was already
meant.

It was the only occurrence. All four scopes re-checked under 1.97.1 report
zero warnings.
The macOS host cannot see these; the first CI run on this branch found them.

`commands::sandbox_profile` is the #506 MVP, macOS-only by design — its only
caller is inside `#[cfg(target_os = "macos")]`, so off macOS all three of its
functions are unreachable. The module declaration now carries the same gate as
its caller instead of compiling into a build that can never call it. Verified
by flipping both cfgs to a target this host is not, and checking: no errors, no
warnings.

The Linux linker branch in `platform_cmd.rs` binds `let mut c`, but only the
`#[cfg(not(target_os = "linux"))]` cross-compile block mutates it, so building
on Linux the `mut` is dead. Scoped allow on the binding, which does apply to
`unused_mut` — verified by flipping the target and watching the warning
disappear.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
crates/perry/src/commands/compile/resolve.rs (2)

908-910: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Guard the wildcard slice bounds.

At Lines 908-910, a subpath can satisfy both starts_with(prefix) and ends_with(suffix) while prefix.len() > subpath.len() - suffix.len(). The resulting range panics instead of rejecting the pattern.

Proposed fix
 if subpath.starts_with(prefix) && subpath.ends_with(suffix) {
-    let matched = &subpath[prefix.len()..subpath.len() - suffix.len()];
+    let Some(end) = subpath.len().checked_sub(suffix.len()) else {
+        continue;
+    };
+    if prefix.len() > end {
+        continue;
+    }
+    let matched = &subpath[prefix.len()..end];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry/src/commands/compile/resolve.rs` around lines 908 - 910, Guard
the slice in the wildcard-matching branch before computing matched in the
resolve logic: require prefix.len() <= subpath.len() - suffix.len() after the
existing prefix and suffix checks, and reject/skip the pattern when the bounds
are invalid. Preserve the current template handling for valid ranges.

903-916: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve wildcard pattern specificity when ordering candidates.

resolve_exports_candidates appends non-exact wildcard candidates in map.iter() order, and resolve_package_entry uses the first candidate that exists on disk. For overlapping patterns, a broad wildcard can win over a more-specific pattern and resolve the wrong entry. Keep existing condition/fallback ordering while sorting wildcard matches from most to least specific before pushing them to out.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry/src/commands/compile/resolve.rs` around lines 903 - 916, Update
wildcard handling in resolve_exports_candidates to collect matching patterns
separately and order them from most to least specific before appending resolved
candidates to out. Preserve the existing match conditions and fallback ordering,
while ensuring resolve_package_entry sees the most-specific wildcard candidate
first.
crates/perry-runtime/src/url/node_compat.rs (1)

842-850: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Root all GC-managed values across allocations.

Lines [842]-[850] retain obj, keys, and the incoming values array while create_string_f64 and js_array_push_f64 may allocate and trigger moving GC. Subsequent field writes or stored pointer values can therefore target stale addresses, corrupting legacy URL objects, or crash. Use RuntimeHandleScope, root the object/array and pointer-bearing inputs, and reload handles after each allocation.

Based on learnings, raw Rust pointers and NaN-boxed values are not reliable GC roots across allocating operations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry-runtime/src/url/node_compat.rs` around lines 842 - 850, Update
create_legacy_url_object to use RuntimeHandleScope for all GC-managed state.
Root the allocated obj and keys handles, and root the pointer-bearing values
input before create_string_f64 or js_array_push_f64 can trigger GC. After each
allocation, reload obj and keys from their handles before setting fields or
keys, ensuring all writes target current objects.

Source: Learnings

🧹 Nitpick comments (1)
crates/perry-codegen/src/stmt/loops.rs (1)

2371-2371: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Remove the unused label computation.

_preheader_label is never read in lower_object_array_write_versioned_for; Line 2371 still clones the block label solely to silence the warning. Delete the assignment instead of retaining dead compile-time work.

Proposed fix
-    let _preheader_label = ctx.block().label.clone();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry-codegen/src/stmt/loops.rs` at line 2371, Remove the unused
_preheader_label assignment from lower_object_array_write_versioned_for,
including the unnecessary ctx.block().label clone; leave the surrounding
lowering logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@changelog.d/6837-rust-warnings-to-zero.md`:
- Line 30: Update the platform name in the changelog text from “watchos” to the
canonical casing “watchOS”; leave the other platform names unchanged.

In `@crates/perry-ext-http-server/src/http2_server.rs`:
- Around line 68-74: Restore the crate-visible re-export of
h2_listening_server_for_authority in the session exports of http2_server.rs so
session.rs and other crate callers can resolve client authorities through the
existing http2_server interface.

In `@crates/perry-ui-macos/src/widgets/qrcode.rs`:
- Line 139: Update the QR image initialization around initWithCGImage:size: to
adopt the already-owned +1 result from the init-style Objective-C call rather
than retaining it again. Remove the extra Retained::retain ownership increment
while preserving the existing image creation and ownership flow.

In `@crates/perry/src/commands/compile.rs`:
- Around line 137-138: Restore the Windows re-export of backend_disabled_msg in
the compile command module, or import it directly in run_pipeline.rs so its
existing use through use super::* remains available when backend-wasm is
disabled.

---

Outside diff comments:
In `@crates/perry-runtime/src/url/node_compat.rs`:
- Around line 842-850: Update create_legacy_url_object to use RuntimeHandleScope
for all GC-managed state. Root the allocated obj and keys handles, and root the
pointer-bearing values input before create_string_f64 or js_array_push_f64 can
trigger GC. After each allocation, reload obj and keys from their handles before
setting fields or keys, ensuring all writes target current objects.

In `@crates/perry/src/commands/compile/resolve.rs`:
- Around line 908-910: Guard the slice in the wildcard-matching branch before
computing matched in the resolve logic: require prefix.len() <= subpath.len() -
suffix.len() after the existing prefix and suffix checks, and reject/skip the
pattern when the bounds are invalid. Preserve the current template handling for
valid ranges.
- Around line 903-916: Update wildcard handling in resolve_exports_candidates to
collect matching patterns separately and order them from most to least specific
before appending resolved candidates to out. Preserve the existing match
conditions and fallback ordering, while ensuring resolve_package_entry sees the
most-specific wildcard candidate first.

---

Nitpick comments:
In `@crates/perry-codegen/src/stmt/loops.rs`:
- Line 2371: Remove the unused _preheader_label assignment from
lower_object_array_write_versioned_for, including the unnecessary
ctx.block().label clone; leave the surrounding lowering logic unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31275f6e-86f1-4769-92e6-d40a41428044

📥 Commits

Reviewing files that changed from the base of the PR and between 8b2c736 and b402ec6.

📒 Files selected for processing (211)
  • .github/workflows/test.yml
  • changelog.d/6837-rust-warnings-to-zero.md
  • crates/perry-codegen-arkts/src/tests/containers.rs
  • crates/perry-codegen-arkts/src/tests/widgets.rs
  • crates/perry-codegen-wasm/src/emit/mod.rs
  • crates/perry-codegen-wasm/src/emit/runtime_imports.rs
  • crates/perry-codegen-wasm/src/emit/ui_method_map.rs
  • crates/perry-codegen/src/codegen/helpers.rs
  • crates/perry-codegen/src/codegen/typed_abi.rs
  • crates/perry-codegen/src/collectors/i64_emit.rs
  • crates/perry-codegen/src/ext_registry.rs
  • crates/perry-codegen/src/lower_call/early_branches.rs
  • crates/perry-codegen/src/lower_call/func_ref.rs
  • crates/perry-codegen/src/lower_call/method_override.rs
  • crates/perry-codegen/src/nm_install.rs
  • crates/perry-codegen/src/stmt/loops.rs
  • crates/perry-codegen/tests/native_proof_buffer_views.rs
  • crates/perry-codegen/tests/native_proof_regressions.rs
  • crates/perry-container-compose/tests/backend_tests.rs
  • crates/perry-doc-tests/src/main.rs
  • crates/perry-ext-http-server/src/handle_dispatch.rs
  • crates/perry-ext-http-server/src/http2_server.rs
  • crates/perry-ext-http/src/agent.rs
  • crates/perry-ext-http/src/lib.rs
  • crates/perry-ext-net/src/lib.rs
  • crates/perry-ext-zlib/src/stream.rs
  • crates/perry-hir/src/destructuring/assignment_expr.rs
  • crates/perry-hir/src/destructuring/assignment_stmt.rs
  • crates/perry-hir/src/js_transform/imports.rs
  • crates/perry-hir/src/lower/builder_fold.rs
  • crates/perry-hir/src/lower/const_fold_fn.rs
  • crates/perry-hir/src/lower/context.rs
  • crates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rs
  • crates/perry-hir/src/lower/fn_ctor_env.rs
  • crates/perry-hir/src/lower/lowering_context.rs
  • crates/perry-hir/src/lower/misc.rs
  • crates/perry-hir/src/lower/pre_scan.rs
  • crates/perry-hir/src/lower_decl/class_captures.rs
  • crates/perry-hir/src/stable_hash/expr.rs
  • crates/perry-hir/src/walker/expr_mut.rs
  • crates/perry-hir/src/walker/expr_ref.rs
  • crates/perry-runtime/src/abi_trampoline.rs
  • crates/perry-runtime/src/array/from_concat.rs
  • crates/perry-runtime/src/array/header.rs
  • crates/perry-runtime/src/array/mod.rs
  • crates/perry-runtime/src/array/push_pop.rs
  • crates/perry-runtime/src/array/species.rs
  • crates/perry-runtime/src/array/tests.rs
  • crates/perry-runtime/src/buffer/dataview.rs
  • crates/perry-runtime/src/buffer/from.rs
  • crates/perry-runtime/src/buffer/header.rs
  • crates/perry-runtime/src/buffer/mutate.rs
  • crates/perry-runtime/src/builtins/formatting.rs
  • crates/perry-runtime/src/builtins/formatting/util_format.rs
  • crates/perry-runtime/src/builtins/globals.rs
  • crates/perry-runtime/src/builtins/mod.rs
  • crates/perry-runtime/src/builtins/numbers.rs
  • crates/perry-runtime/src/bun_ffi/call.rs
  • crates/perry-runtime/src/child_process/sync_run.rs
  • crates/perry-runtime/src/child_process/v8_serde.rs
  • crates/perry-runtime/src/closure/dispatch/bound.rs
  • crates/perry-runtime/src/closure/dynamic_props.rs
  • crates/perry-runtime/src/collection_iter.rs
  • crates/perry-runtime/src/date.rs
  • crates/perry-runtime/src/date/parse.rs
  • crates/perry-runtime/src/dgram.rs
  • crates/perry-runtime/src/dns.rs
  • crates/perry-runtime/src/error.rs
  • crates/perry-runtime/src/fs/cp.rs
  • crates/perry-runtime/src/fs/dir_glob_watch/glob.rs
  • crates/perry-runtime/src/fs/fd_ops.rs
  • crates/perry-runtime/src/fs/fd_sync_ops.rs
  • crates/perry-runtime/src/fs/mod.rs
  • crates/perry-runtime/src/fs/validate.rs
  • crates/perry-runtime/src/gc/barrier.rs
  • crates/perry-runtime/src/gc/cycle.rs
  • crates/perry-runtime/src/gc/heap_snapshot.rs
  • crates/perry-runtime/src/gc/mod.rs
  • crates/perry-runtime/src/gc/oldgen.rs
  • crates/perry-runtime/src/gc/policy.rs
  • crates/perry-runtime/src/gc/roots.rs
  • crates/perry-runtime/src/gc/telemetry.rs
  • crates/perry-runtime/src/gc/tests/cycle_state.rs
  • crates/perry-runtime/src/gc/trace.rs
  • crates/perry-runtime/src/gc/verify.rs
  • crates/perry-runtime/src/intl.rs
  • crates/perry-runtime/src/intl/date_collator.rs
  • crates/perry-runtime/src/intl/date_collator/temporal.rs
  • crates/perry-runtime/src/intl/number_format.rs
  • crates/perry-runtime/src/json/reviver.rs
  • crates/perry-runtime/src/node_stream.rs
  • crates/perry-runtime/src/node_stream_constructors/web_adapter.rs
  • crates/perry-runtime/src/node_stream_iter_helpers.rs
  • crates/perry-runtime/src/node_stream_readable_read.rs
  • crates/perry-runtime/src/node_stream_readwrite.rs
  • crates/perry-runtime/src/node_stream_tests_extra.rs
  • crates/perry-runtime/src/node_submodules/consumers.rs
  • crates/perry-runtime/src/node_submodules/diagnostics.rs
  • crates/perry-runtime/src/node_submodules/fs_promises.rs
  • crates/perry-runtime/src/node_submodules/mod.rs
  • crates/perry-runtime/src/node_submodules/stream_promises.rs
  • crates/perry-runtime/src/node_submodules/test.rs
  • crates/perry-runtime/src/node_submodules/tests.rs
  • crates/perry-runtime/src/node_submodules/trace_events.rs
  • crates/perry-runtime/src/node_test.rs
  • crates/perry-runtime/src/node_v8.rs
  • crates/perry-runtime/src/object/assert.rs
  • crates/perry-runtime/src/object/class_registry.rs
  • crates/perry-runtime/src/object/class_registry/class_meta.rs
  • crates/perry-runtime/src/object/class_registry/dispatch.rs
  • crates/perry-runtime/src/object/class_registry/gc_roots.rs
  • crates/perry-runtime/src/object/class_registry/registration.rs
  • crates/perry-runtime/src/object/delete_rest.rs
  • crates/perry-runtime/src/object/field_get_set/enumeration.rs
  • crates/perry-runtime/src/object/field_get_set/get_field_by_name.rs
  • crates/perry-runtime/src/object/field_get_set/has_property.rs
  • crates/perry-runtime/src/object/field_get_set/ic_miss.rs
  • crates/perry-runtime/src/object/global_this/array_error.rs
  • crates/perry-runtime/src/object/global_this/bigint_promise.rs
  • crates/perry-runtime/src/object/map_set_subclass.rs
  • crates/perry-runtime/src/object/mod.rs
  • crates/perry-runtime/src/object/native_module.rs
  • crates/perry-runtime/src/object/native_module/callable_export_check.rs
  • crates/perry-runtime/src/object/native_module/callable_exports.rs
  • crates/perry-runtime/src/object/native_module/constants.rs
  • crates/perry-runtime/src/object/native_module/module_keys.rs
  • crates/perry-runtime/src/object/native_module_dispatch/dispatch_d_i.rs
  • crates/perry-runtime/src/object/native_module_dispatch/dispatch_m_p.rs
  • crates/perry-runtime/src/object/native_module_dispatch_crypto.rs
  • crates/perry-runtime/src/object/object_ops.rs
  • crates/perry-runtime/src/object/object_ops/define_properties.rs
  • crates/perry-runtime/src/object/tests.rs
  • crates/perry-runtime/src/object/util_types.rs
  • crates/perry-runtime/src/object/with_env.rs
  • crates/perry-runtime/src/path.rs
  • crates/perry-runtime/src/perf_hooks.rs
  • crates/perry-runtime/src/plugin.rs
  • crates/perry-runtime/src/pointer_event.rs
  • crates/perry-runtime/src/process.rs
  • crates/perry-runtime/src/process/credentials.rs
  • crates/perry-runtime/src/promise/combinators.rs
  • crates/perry-runtime/src/promise/keyed_table.rs
  • crates/perry-runtime/src/promise/mod.rs
  • crates/perry-runtime/src/promise/then.rs
  • crates/perry-runtime/src/regex.rs
  • crates/perry-runtime/src/regex/tests.rs
  • crates/perry-runtime/src/regex/utf16.rs
  • crates/perry-runtime/src/safe_area.rs
  • crates/perry-runtime/src/string/compare.rs
  • crates/perry-runtime/src/string/intern.rs
  • crates/perry-runtime/src/string/tests.rs
  • crates/perry-runtime/src/string/tests_guard_page.rs
  • crates/perry-runtime/src/temporal/dispatch.rs
  • crates/perry-runtime/src/tty.rs
  • crates/perry-runtime/src/tui/layout.rs
  • crates/perry-runtime/src/typedarray/mod.rs
  • crates/perry-runtime/src/url/mod.rs
  • crates/perry-runtime/src/url/node_compat.rs
  • crates/perry-runtime/src/url/search_params.rs
  • crates/perry-runtime/src/util_promisify.rs
  • crates/perry-runtime/src/weakref.rs
  • crates/perry-stdlib/src/commander.rs
  • crates/perry-stdlib/src/common/dispatch.rs
  • crates/perry-stdlib/src/crypto/sign.rs
  • crates/perry-stdlib/src/fetch/dispatch.rs
  • crates/perry-stdlib/src/http.rs
  • crates/perry-stdlib/src/querystring.rs
  • crates/perry-stdlib/src/sqlite/connection.rs
  • crates/perry-stdlib/src/sqlite/dispatch.rs
  • crates/perry-stdlib/src/streams/transform.rs
  • crates/perry-stdlib/src/streams/writable.rs
  • crates/perry-stdlib/src/tls.rs
  • crates/perry-stdlib/src/zlib.rs
  • crates/perry-transform/src/generator/lower.rs
  • crates/perry-ui-geisterhand/src/server.rs
  • crates/perry-ui-macos/src/app.rs
  • crates/perry-ui-macos/src/audio.rs
  • crates/perry-ui-macos/src/audio_playback.rs
  • crates/perry-ui-macos/src/crash_log.rs
  • crates/perry-ui-macos/src/geolocation.rs
  • crates/perry-ui-macos/src/network.rs
  • crates/perry-ui-macos/src/widgets/adbanner.rs
  • crates/perry-ui-macos/src/widgets/canvas.rs
  • crates/perry-ui-macos/src/widgets/chart.rs
  • crates/perry-ui-macos/src/widgets/combobox.rs
  • crates/perry-ui-macos/src/widgets/hstack.rs
  • crates/perry-ui-macos/src/widgets/image.rs
  • crates/perry-ui-macos/src/widgets/mod.rs
  • crates/perry-ui-macos/src/widgets/qrcode.rs
  • crates/perry-ui-macos/src/widgets/table.rs
  • crates/perry-ui-macos/src/widgets/tree_view.rs
  • crates/perry-ui-macos/src/widgets/vstack.rs
  • crates/perry-ui-macos/src/widgets/webview.rs
  • crates/perry/src/commands/compile.rs
  • crates/perry/src/commands/compile/cjs_wrap/detect.rs
  • crates/perry/src/commands/compile/cjs_wrap/extract_requires.rs
  • crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs
  • crates/perry/src/commands/compile/collect_modules.rs
  • crates/perry/src/commands/compile/helpers.rs
  • crates/perry/src/commands/compile/object_cache.rs
  • crates/perry/src/commands/compile/optimized_libs.rs
  • crates/perry/src/commands/compile/optimized_libs/driver.rs
  • crates/perry/src/commands/compile/optimized_libs/freshness.rs
  • crates/perry/src/commands/compile/optimized_libs/no_auto.rs
  • crates/perry/src/commands/compile/optimized_libs/paths.rs
  • crates/perry/src/commands/compile/optimized_libs/tests.rs
  • crates/perry/src/commands/compile/resolve.rs
  • crates/perry/src/commands/compile/run_pipeline.rs
  • crates/perry/src/commands/compile/types.rs
  • crates/perry/src/commands/publish/mod.rs
  • crates/perry/tests/issue_4914_cluster_port_sharing.rs
💤 Files with no reviewable changes (65)
  • crates/perry-codegen-wasm/src/emit/runtime_imports.rs
  • crates/perry-container-compose/tests/backend_tests.rs
  • crates/perry-ext-http-server/src/handle_dispatch.rs
  • crates/perry-runtime/src/object/native_module_dispatch_crypto.rs
  • crates/perry-codegen-arkts/src/tests/containers.rs
  • crates/perry/src/commands/compile/optimized_libs/paths.rs
  • crates/perry-runtime/src/object/mod.rs
  • crates/perry-codegen-wasm/src/emit/mod.rs
  • crates/perry/src/commands/compile/optimized_libs/no_auto.rs
  • crates/perry-runtime/src/buffer/dataview.rs
  • crates/perry-ext-http/src/agent.rs
  • crates/perry-runtime/src/object/class_registry/gc_roots.rs
  • crates/perry-ext-http/src/lib.rs
  • crates/perry-stdlib/src/crypto/sign.rs
  • crates/perry-runtime/src/builtins/mod.rs
  • crates/perry-runtime/src/url/mod.rs
  • crates/perry-codegen/src/codegen/typed_abi.rs
  • crates/perry-hir/src/lower/misc.rs
  • crates/perry-doc-tests/src/main.rs
  • crates/perry-runtime/src/temporal/dispatch.rs
  • crates/perry-runtime/src/buffer/header.rs
  • crates/perry-ui-macos/src/network.rs
  • crates/perry-runtime/src/date.rs
  • crates/perry-runtime/src/dgram.rs
  • crates/perry-hir/src/walker/expr_mut.rs
  • crates/perry-hir/src/lower/context.rs
  • crates/perry-hir/src/lower_decl/class_captures.rs
  • crates/perry-runtime/src/fs/cp.rs
  • crates/perry-runtime/src/typedarray/mod.rs
  • crates/perry-runtime/src/node_stream_readable_read.rs
  • crates/perry/src/commands/compile/cjs_wrap/extract_requires.rs
  • crates/perry-runtime/src/json/reviver.rs
  • crates/perry-codegen-wasm/src/emit/ui_method_map.rs
  • crates/perry-runtime/src/array/species.rs
  • crates/perry-runtime/src/node_submodules/test.rs
  • crates/perry-runtime/src/object/native_module.rs
  • crates/perry-hir/src/walker/expr_ref.rs
  • crates/perry-ext-net/src/lib.rs
  • crates/perry-hir/src/destructuring/assignment_stmt.rs
  • crates/perry-stdlib/src/streams/writable.rs
  • crates/perry/src/commands/compile/cjs_wrap/detect.rs
  • crates/perry-hir/src/lower/pre_scan.rs
  • crates/perry-runtime/src/node_test.rs
  • crates/perry-codegen/src/lower_call/method_override.rs
  • crates/perry-hir/src/destructuring/assignment_expr.rs
  • crates/perry-codegen/src/nm_install.rs
  • crates/perry-runtime/src/node_stream_readwrite.rs
  • crates/perry-runtime/src/object/native_module_dispatch/dispatch_d_i.rs
  • crates/perry-codegen/src/codegen/helpers.rs
  • crates/perry-runtime/src/fs/validate.rs
  • crates/perry-hir/src/stable_hash/expr.rs
  • crates/perry/src/commands/compile/cjs_wrap/hoist_classes.rs
  • crates/perry-codegen/src/lower_call/func_ref.rs
  • crates/perry-runtime/src/collection_iter.rs
  • crates/perry-runtime/src/node_stream_iter_helpers.rs
  • crates/perry-codegen/src/lower_call/early_branches.rs
  • crates/perry-runtime/src/object/native_module_dispatch/dispatch_m_p.rs
  • crates/perry-runtime/src/intl/date_collator.rs
  • crates/perry/src/commands/compile/run_pipeline.rs
  • crates/perry-hir/src/lower/expr_call/intrinsics/eval_strict.rs
  • crates/perry-runtime/src/gc/barrier.rs
  • crates/perry-runtime/src/object/native_module/module_keys.rs
  • crates/perry-runtime/src/object/native_module/callable_export_check.rs
  • crates/perry-hir/src/lower/lowering_context.rs
  • crates/perry-runtime/src/promise/then.rs

Eleven warnings appeared only under the reduced feature set `perry` selects
(`default-features = false` on perry-runtime), where regex-engine,
diagnostics and temporal are off. Those items are gated at the item, not
suppressed. The cross-host UI crates (ios/tvos/watchos/visionos/android/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use the canonical platform casing.

Change watchos to watchOS in the changelog.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~30-~30: The operating system from Apple is written “watchOS”.
Context: ...sed. The cross-host UI crates (ios/tvos/watchos/visionos/android/ windows/gtk4) canno...

(MAC_OS)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@changelog.d/6837-rust-warnings-to-zero.md` at line 30, Update the platform
name in the changelog text from “watchos” to the canonical casing “watchOS”;
leave the other platform names unchanged.

Source: Linters/SAST tools

Comment on lines +68 to +74
has_active_h2_clients, process_pending_h2, process_pending_h2_events,
try_recv_pending_h2_nonblocking,
};
pub(crate) use session::{
h2_listening_server_for_authority, local_client_connect_ready, local_server_handle_for_client,
local_server_session_event_ready, mark_server_sessions_closed, mark_session_closed,
parse_headers_object, register_server_session, start_client_request,
local_client_connect_ready, local_server_handle_for_client, local_server_session_event_ready,
mark_server_sessions_closed, mark_session_closed, parse_headers_object,
register_server_session, start_client_request,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep the HTTP/2 authority resolver crate-visible.

crates/perry-ext-http-server/src/http2_server/session.rs still depends on h2_listening_server_for_authority when resolving a client session’s local server handle. Restore this re-export, or update every caller to import the defining module directly.

Proposed fix
 pub(crate) use session::{
+    h2_listening_server_for_authority,
     local_client_connect_ready, local_server_handle_for_client, local_server_session_event_ready,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
has_active_h2_clients, process_pending_h2, process_pending_h2_events,
try_recv_pending_h2_nonblocking,
};
pub(crate) use session::{
h2_listening_server_for_authority, local_client_connect_ready, local_server_handle_for_client,
local_server_session_event_ready, mark_server_sessions_closed, mark_session_closed,
parse_headers_object, register_server_session, start_client_request,
local_client_connect_ready, local_server_handle_for_client, local_server_session_event_ready,
mark_server_sessions_closed, mark_session_closed, parse_headers_object,
register_server_session, start_client_request,
has_active_h2_clients, process_pending_h2, process_pending_h2_events,
try_recv_pending_h2_nonblocking,
};
pub(crate) use session::{
h2_listening_server_for_authority,
local_client_connect_ready, local_server_handle_for_client, local_server_session_event_ready,
mark_server_sessions_closed, mark_session_closed, parse_headers_object,
register_server_session, start_client_request,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry-ext-http-server/src/http2_server.rs` around lines 68 - 74,
Restore the crate-visible re-export of h2_listening_server_for_authority in the
session exports of http2_server.rs so session.rs and other crate callers can
resolve client authorities through the existing http2_server interface.

let ns_image_raw: *mut AnyObject = msg_send![ns_image_cls, alloc];
let ns_image_raw: *mut AnyObject =
msg_send![ns_image_raw, initWithCGImage: cg_image size: target_size];
msg_send![ns_image_raw, initWithCGImage: cg_image, size: target_size];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files | rg '(^|/)qrcode\.rs$|(^|/)Cargo\.toml$|(^|/)CLAUDE\.md$|(^|/)\.node-version$' || true

echo "== target file outline =="
ast-grep outline crates/perry-ui-macos/src/widgets/qrcode.rs --view compact || true

echo "== target section =="
cat -n crates/perry-ui-macos/src/widgets/qrcode.rs | sed -n '120,155p'

echo "== Retained usages in qrcode =="
rg -n "Retained|ns_image_raw|initWithCGImage|retain|forget" crates/perry-ui-macos/src/widgets/qrcode.rs crates/perry-ui-macos/src -g '*.rs' || true

echo "== local objc2 version =="
rg -n "objc2" crates/perry-ui-macos/Cargo.toml Cargo.toml crates -g 'Cargo.toml' | head -80 || true

Repository: PerryTS/perry

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== all InitWithCGImage usage sites =="
rg -n "initWithCGImage|initWithCGImage:" crates/perry-ui-macos/src -g '*.rs' || true

echo "== local objc2 versions in workspace =="
rg -n 'name = "objc2"|^[[:space:]]*objc2[[:space:]]*=' Cargo.toml crates -g 'Cargo.toml' | head -120 || true

echo "== nearby generate_qr_image caller/usages =="
rg -n "generate_qr_image|QR|qrcode|qrcode" crates/perry-ui-macos/src -g '*.rs' || true

echo "== inspect qrcode top/imports =="
cat -n crates/perry-ui-macos/src/widgets/qrcode.rs | sed -n '1,70p'

Repository: PerryTS/perry

Length of output: 6206


🌐 Web query:

Apple Foundation NSImage initWithCGImage:size: returns new object Retained object documentation

💡 Result:

The NSImage initializer initWithCGImage:size: creates a new NSImage object that references the provided CGImage [1]. Regarding memory management, when you use this initializer, the underlying CGImage is maintained by the NSImage for its use [1]. It is standard Cocoa convention that the caller is not responsible for releasing the CGImage after passing it to this initializer [1]. The CGImage remains valid for the life of the NSImage object or as otherwise required by the framework's internal management [1]. You do not need to manually retain or release the CGImage passed into this method, as the system handles the necessary reference counting [1]. Older methods related to data retention, such as setDataRetained: and isDataRetained, have been deprecated since Mac OS X 10.6, as modern NSImage implementations manage image data efficiently without requiring manual retention flags [2].

Citations:


Adopt the +1 result from initWithCGImage:size: instead of retaining it again.

init-style Objective-C methods on the result of alloc return an already-owned (+1) object; using Retained::retain here increments ownership again. The current loop increments the returned object’s retain count once per QR image and leaves an extra retained object behind via mem::forget.

Proposed ownership fix
-    let ns_image: Retained<NSImage> = Retained::retain(ns_image_raw as *mut NSImage)?;
-    // Balance the retain (init already gives us +1)
-    std::mem::forget(Retained::retain(ns_image_raw as *mut NSImage));
+    // SAFETY: initWithCGImage:size: returns an owned (+1) object.
+    let ns_image: Retained<NSImage> =
+        unsafe { Retained::from_raw(ns_image_raw as *mut NSImage)? };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry-ui-macos/src/widgets/qrcode.rs` at line 139, Update the QR image
initialization around initWithCGImage:size: to adopt the already-owned +1 result
from the init-style Objective-C call rather than retaining it again. Remove the
extra Retained::retain ownership increment while preserving the existing image
creation and ownership flow.

Comment on lines +137 to +138
apply_libc_to_target, canonical_class_source_prefix, native_object_file_stem,
object_cache_project_root, print_deferred_eval_notice, NativeObjectArtifact,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Preserve the Windows backend_disabled_msg re-export.

crates/perry/src/commands/compile/run_pipeline.rs imports this module via use super::* and calls backend_disabled_msg(...) when backend-wasm is disabled. Removing the symbol from the Windows re-export makes that configuration fail to compile.

Restore the re-export or import the helper directly in run_pipeline.rs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry/src/commands/compile.rs` around lines 137 - 138, Restore the
Windows re-export of backend_disabled_msg in the compile command module, or
import it directly in run_pipeline.rs so its existing use through use super::*
remains available when backend-wasm is disabled.

The import block read:

    #[cfg(unix)]
    use std::os::unix::fs::{MetadataExt, PermissionsExt};
    #[cfg(unix)]
    use std::os::unix::io::AsRawFd;
    use std::path::Path;

`cargo fix` deleted the unused `AsRawFd` line and left its `#[cfg(unix)]`
behind, which then applied to the `Path` import below it. Every unix host still
compiled; Windows failed with four `cannot find type Path` errors.

Swept the whole diff for the same shape — an attribute that outlived the item
it was written for — and this was the only one. The other new cfg/import
adjacencies are deliberate.
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.

1 participant