Skip to content

main red: cargo build -p perry fails to compile perry-runtime (diagnostics #3082 + console as_str) #3260

@proggeramlug

Description

@proggeramlug

Summary

main CI is red: cargo build --release -p perry (run by regen_api_docs.sh, and the same compile path used by cargo-test, lint/clippy, and compiler-output-regression) fails to compile perry-runtime with 5 errors. Every PR opened against current main inherits these failures (e.g. #3238), so the parity sweep is effectively blocked.

The breakage compiles fine under a build that enables the full feature on perry-runtime (e.g. cargo build -p perry-runtime -p perry-stdlib -p perry, which is why it passed local checks), but not under cargo build -p perry alone (CI's path), where perry-runtime is built without full. So it slipped through.

Errors (cargo build --release -p perry)

error[E0425]: cannot find function `js_register_closure_synthetic_arguments` in this scope
  --> crates/perry-runtime/src/node_submodules/diagnostics.rs:1125
error[E0425]: cannot find function `js_array_new` in this scope
  --> crates/perry-runtime/src/node_submodules/diagnostics.rs:1135
error[E0425]: cannot find function `js_array_push` in this scope
  --> crates/perry-runtime/src/node_submodules/diagnostics.rs:1137
error[E0425]: cannot find function `js_nanbox_get_pointer` in this scope
  --> crates/perry-runtime/src/node_submodules/diagnostics.rs:1145
error[E0599]: no method named `as_str` found for struct `string::StringHeader`
  --> crates/perry-runtime/src/builtins/console.rs:600

Root cause

  • diagnostics.rs (build_arg_array / unbox_arg_array / run_stores_method_closure, from node:diagnostics_channel: forward all runStores callback arguments #3082/fix(node:diagnostics_channel): forward runStores callback arguments (#3082) #3182) uses bare js_array_new(), js_array_push(arr, v), js_nanbox_get_pointer(...), js_register_closure_synthetic_arguments(...). The rest of the file uses full paths (crate::value::js_nanbox_get_pointer, etc.); these four resolve only via a full-gated glob. Note js_array_new does not exist anywhere in the tree, and js_array_push in array/jsvalue_api.rs takes a JSValue, not the f64 passed here — so this code path appears unfinished.
  • console.rs:600 (is_callable, from the Console-options validation work) calls (*header).as_str() on a *mut StringHeader; StringHeader has no as_str. It needs a manual byte read (cf. label_from_str_ptr).

Suggested fix

Full-path/correct the four calls in diagnostics.rs (and use js_array_push_f64 + the right empty-array constructor), and replace the as_str() comparison in console.rs with a byte-slice compare against b"function". I held off patching these directly since they're partly unfinished runtime code and the intended js_array_new/js_array_push shapes are ambiguous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions