Add initial FreeBSD support - #20480
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @CalebHeydon on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
| context.set("os", "macos"); | ||
| #[cfg(target_os = "linux")] | ||
| #[cfg(any(target_os = "linux", target_os = "freebsd"))] | ||
| context.set("os", "linux"); |
There was a problem hiding this comment.
This and another place below with Self::Linux looks quite odd, so welcome to fix in in the future PRs.
There was a problem hiding this comment.
Thanks for pointing that out. It probably is correct to set the context to linux, but I'll need to prevent it from setting it to unknown.
MFC'ed after a week unfortunately it won't land in the upcoming 14.2-RELEASE. Until then, you can use |
|
Hey, Thanks |
|
I have mini gist with basic to install. |
Thats perfect! i will try it |
|
I had tried building on FreeBSD 15, following these instructions However now it seems to be stuck at missing webrtc deps, what am i missing, i didnt see any mentions of having to install alsa/webrtc |
|
i don't know if with alsa wrtc works, I'm FreeBSD 14.1 and pulseaudio wrtc-audio (I prefer oss), but I don't know works fine in 15-current. If not works try other old commit. |
This is triggered here: Same root cause of the the issue reported here: |
Oddly enough this was not the error i was seeing yesterday and it seemed that commit bf569d7 worked yesterday. However today when i was trying to narrow down what commit broke the current build i started running into the 404 error that you mention. |
|
hi,
i.e. the outcome after the installation of those is that native "open file" dialog window starts to appear and seems functions properly. Unfortunately once installed it substantially increases cpu usage by zed to the point that laptop's fan never stops. And such nasty behavior is observed even when zed is simply started (no editing work is done, nothing is opened). |
Hi, Or am I wrong and smb. was lucky and was able to build >=v0.166+ on FreeBSD? |
Thanks! I have not success with recent builds, but I'm trying to compile rust-sdks and client its. |
|
@G36maid Can you please start a clean discussion thread rather than commenting here. Merged PRs are not a place for new discussion. I believe what you are seeing is related to this: |
This PR contains a set of changes for improving FreeBSD support (#15309, #29550) and is a kind of follow up to the PR #20480 which added an initial support for FreeBSD. A summary of changes is as follows: - Add some more freebsd conditionals which seem missing in the previous PR. - Implement `anonymous_fd()` and `current_path()` functions for FreeBSD. - Improve detection of FreeBSD in telemetry and GPU detection. - Temporarily disable LiveKit/WebRTC support to make build succeed. - Remove support for flatpak since it is Linux-only packaging format. Adding `RUSTFLAGS="-C link-dead-code"` does not seem necessary anymore. It builds fine without the flag. Known issues: - Integrated terminal is painfully laggy and virtually unusable in my environment. This might be specific to my setup. - I cannot input Japanese using IME. When I type characters, they appear on the screen. But when I hit return key, they disappears. Seems the same issue as #15409. My environment is MATE desktop on X11 on FreeBSD 14.2 on Intel Core i5-7260U integrated graphics. P.S. For those who might be interested, a work-in-progress FreeBSD port and binary packages are available at https://github.com/tagattie/FreeBSD-Zed Release Notes: - N/A --------- Co-authored-by: Peter Tripp <peter@zed.dev>
This PR adds initial support for FreeBSD (zed-industries#15309). While there is still work left to be done, it seems to be usable. As discussed by @syobocat (zed-industries#10247), the changes were just adding ```target_os = "freebsd"``` to wherever it checks if the OS is Linux.  Needs to be build with ```RUSTFLAGS="-C link-dead-code"``` Known Issues: - There's an issue in ```crates/project/src/environment.rs``` where a command fails because ```/bin/sh``` on FreeBSD doesn't support the ```-l``` option.  - The file/folder choosers provided by the ```ashpd``` crate don't work on FreeBSD (at least with KDE). This isn't that bad since a fallback dialog is used.  - Moving to trash won't work. - Numerous tests fail (when running on FreeBSD). While I haven't looked into this much, it appears that the corresponding features seem to work fine. Release Notes: - Added initial support for FreeBSD
This PR contains a set of changes for improving FreeBSD support (zed-industries#15309, zed-industries#29550) and is a kind of follow up to the PR zed-industries#20480 which added an initial support for FreeBSD. A summary of changes is as follows: - Add some more freebsd conditionals which seem missing in the previous PR. - Implement `anonymous_fd()` and `current_path()` functions for FreeBSD. - Improve detection of FreeBSD in telemetry and GPU detection. - Temporarily disable LiveKit/WebRTC support to make build succeed. - Remove support for flatpak since it is Linux-only packaging format. Adding `RUSTFLAGS="-C link-dead-code"` does not seem necessary anymore. It builds fine without the flag. Known issues: - Integrated terminal is painfully laggy and virtually unusable in my environment. This might be specific to my setup. - I cannot input Japanese using IME. When I type characters, they appear on the screen. But when I hit return key, they disappears. Seems the same issue as zed-industries#15409. My environment is MATE desktop on X11 on FreeBSD 14.2 on Intel Core i5-7260U integrated graphics. P.S. For those who might be interested, a work-in-progress FreeBSD port and binary packages are available at https://github.com/tagattie/FreeBSD-Zed Release Notes: - N/A --------- Co-authored-by: Peter Tripp <peter@zed.dev>

This PR adds initial support for FreeBSD (#15309). While there is still work left to be done, it seems to be usable. As discussed by @syobocat (#10247), the changes were just adding
target_os = "freebsd"to wherever it checks if the OS is Linux.Needs to be build with
RUSTFLAGS="-C link-dead-code"Known Issues:
crates/project/src/environment.rswhere a command fails because/bin/shon FreeBSD doesn't support the-loption.ashpdcrate don't work on FreeBSD (at least with KDE). This isn't that bad since a fallback dialog is used.Release Notes: