Skip to content

wasm32 build is broken #77

Open

Description

@dstoc
  • error[E0560]: struct HarmonyEncoding has no field named conversation_has_function_tools
  • error[E0433]: failed to resolve: use of undeclared type AtomicBool

harmony/src/registry.rs

Lines 118 to 120 in 508cbaa

]),
conversation_has_function_tools: Arc::new(AtomicBool::new(false)),
})

  • error[E0425]: cannot find function load_encoding_from_bytes in this scope

#[cfg(target_arch = "wasm32")]
{
load_encoding_from_bytes(&vocab_bytes, None, specials, &self.pattern())
}

Activity

  1. lets-order-some-fries commented on Sep 23, 2026

    @lets-order-some-fries

    Opened #156 for this.

    All three error classes reproduce on today's main — five errors total. Two causes, both cfg branches nothing ever built:

    • registry.rs duplicated the whole HarmonyEncoding struct literal across the native and wasm32 loaders. d00ac3d ("make HarmonyEncoding usable concurrently", 2025-08-05) removed conversation_has_function_tools and updated only the native copy, which is where the E0560 and E0433 come from.
    • load_encoding_from_bytes was never defined; only load_encoding_from_file exists, hence the three E0425s.

    Rather than re-sync the two struct literals and leave them free to drift again, the shared construction moves into one helper so the loaders differ only in blocking vs async. The PR also adds a wasm32 CI check — without one this rots again, having gone a year unnoticed. It is a separate workflow file because CI.yml is maturin-generated and a job added there would be lost on regeneration.

    cargo check --target wasm32-unknown-unknown --lib now exits 0; cargo test still 31 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions