Skip to content

🚀 Feature Request: Please provide FreeBSD support #3882

Open

Description

@windymelt

Describe the solution

Currently we cannot install wrangler in FreeBSD environment:

$ npm install wrangler --save-dev
...
Error: Unsupported platform: freebsd x64 LE

Wrangler should run if it use standard Node.js feature. Any blockers existing?

Activity

  1. petebacondarwin commented on Apr 4, 2025

    @petebacondarwin
    Contributor

    This is due to workerd needing to be compiled for each platform and I believe FreeBSD is not in the list of compiled versions.
    Transferring to the workerd repo to be triaged there.

  2. kentonv commented on Apr 4, 2025

    @kentonv
    Member

    Years ago I got FreeBSD working in #83 but due to several outstanding issues it wasn't merged (see PR description). Of course, the patch probably doesn't work anymore, but it could be used as a guide for someone to try again today. Maybe some of the tooling problems I ran into have been fixed in the meantime?

    Practically speaking, we probably cannot commit to supporting FreeBSD officially, as nobody on the team knows much about it. But, I'm willing to accept patches from the community to make it work, if they are reasonably non-invasive.

  3. kentonv commented on Apr 4, 2025

    @kentonv
    Member

    On the other hand, I would expect FreeBSD's Linux ABI emulation should work for running workerd binaries as-is. That might be a more practical approach for most users than trying to actually port the code?

  4. rclenzi commented on May 22, 2026

    @rclenzi

    Hi @kentonv,

    I saw your draft PR and wanted to share that I've been working on getting workerd to build and run on FreeBSD 15. I'm not an expert in either workerd internals or FreeBSD ports, but with some help from AI tools I managed to get a fully working port.

    The result:

    • Builds successfully with Bazel 9 on FreeBSD 15.0-RELEASE
    • 151 tests passing (jsg, util, api, io)
    • JavaScript Workers: ~20K req/s (optimized build)
    • Python Workers via Pyodide: working
    • Full FreeBSD port ready for submission to the ports tree

    The approach is different from yours — instead of a clang wrapper, I used per_file_copt in a freebsd.bazelrc to handle the header visibility issues, patched the toolchain dependencies (rules_python, rules_rust, aspect_rules_js) for FreeBSD support, and created proper FreeBSD toolchain registrations for Node.js,
    esbuild, tar, and coreutils.

    My repo with the complete port: https://github.com/rclenzi/workerd-freebsd-port

    The C++ changes to workerd itself are minimal (7 small patches — endianness, pthread, stat.h, environ, process.platform). I'd be happy to submit these as a proper PR if there's interest in having FreeBSD as a supported platform, even unofficially.

    Would appreciate any feedback on the approach.

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