[Bug 293816] editors/zed

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 14 Mar 2026 23:10:54 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293816

            Bug ID: 293816
           Summary: editors/zed
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: tagattie@FreeBSD.org
          Reporter: mail@jholloway.dev
          Assignee: tagattie@FreeBSD.org
             Flags: maintainer-feedback?(tagattie@FreeBSD.org)
 Attachment #268812 text/plain
         mime type:

Created attachment 268812
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=268812&action=edit
Patch file for crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs

After installing the Typst extension and its respective LSP,  TinyMist, Zed
would crash soon after opening the directory containing any .typ files.

After running Zed from the command line with the --foreground flag and setting
env RUST_BACKTRACE=1 I was able to find the cause of the crash:

thread 'tokio-runtime-worker' (146651) panicked at
crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs:840:22:
unsupported os
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose
backtrace.

The cause of the panic is a match statement inside of the current_platform()
function inside of crates/extension_host/src/wasm_host/wit/since_v0_8_0.rs  
Because FreeBSD is not in the list of supported operating systems the function
panics.  

impl platform::Host for WasmState {
    async fn current_platform(&mut self) -> Result<(platform::Os,
platform::Architecture)> {
        Ok((
            match env::consts::OS {
                "macos" => platform::Os::Mac,
                "linux" => platform::Os::Linux,
                "windows" => platform::Os::Windows,
                _ => panic!("unsupported os"),
            },
           // ... omitted
     }      
}
The solution to this bug can be found by adding the string "freebsd" to the
list of supported systems, and returning the enum platform::Os::Linux as many
of these extensions work well due to FreeBSD's similar ABI and Linux
Compatibility Layer. 
"linux" | "freebsd"  => platform::Os::Linux,

This will address the error and prevent the crash. This also resolves the same
crash for any other WASM-based extension that calls current_platform(),
including the LaTeX, HTML, GLSL, and typos extensions.

Please see the attached patch file

-- 
You are receiving this mail because:
You are the assignee for the bug.