hn.today

Lying to Zed to get its remote server running on FreeBSD

hayzam.com28 points7 comments
Screenshot of Lying to Zed to get its remote server running on FreeBSD

Zed’s remote-development server does not officially support FreeBSD, but its Linux build can run through FreeBSD’s Linux compatibility layer. The workaround enables Linux compatibility, installs the Rocky Linux 9 base, and places a small `uname` wrapper earlier in the SSH session’s PATH. The wrapper reports Linux x86_64 when Zed checks the host platform, while leaving other system queries unchanged, so Zed downloads and launches its own Linux server. This approach stays aligned with Zed’s releases, unlike FreeBSD’s native port, which must match the editor version and can lag behind. A successful connection also requires a FreeBSD kernel containing a directory-listing fix; without it, Zed may connect but display an empty project.

The underlying failure was in FreeBSD’s Linuxulator, which translates Linux directory-reading calls. A 2026 change rounded native reads up to 512-byte blocks, allowing a batch to exceed the application’s 768-byte buffer. The kernel had already advanced past directory entries that could not fit, so the translator returned an error and Zed treated the folder as unreadable; a quieter attempted workaround instead omitted 112 of 1,002 files. The correction limits reads to the caller’s buffer when it is at least 512 bytes, and rounds up only for smaller requests. It fixes both legacy and 64-bit `getdents` paths, passed the test matrix after an initial partial patch left 86 failures, and is included in the main and stable/15 branches, with FreeBSD 15.2-RELEASE expected to carry it.

Read on hayzam.com7 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Ggml v1.0.0

Ggml v1.0.0

ggml 1.0.0 removes deprecated public APIs and legacy DIAG_MASK operations, while adding configurable YaRN truncation and FP8 support. It also improves backend performance with quantized matrix multiplication, fused MoE operations, and new attention and scheduling paths. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.