You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🚀 Feature Request: Please provide FreeBSD support #3882
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.
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.
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?
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.
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.
Activity
petebacondarwin commentedon Apr 4, 2025
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.
kentonv commentedon Apr 4, 2025
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.
kentonv commentedon Apr 4, 2025
On the other hand, I would expect FreeBSD's Linux ABI emulation should work for running
workerdbinaries as-is. That might be a more practical approach for most users than trying to actually port the code?rclenzi commentedon May 22, 2026
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:
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.