Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial FreeBSD support #20480

Merged
merged 2 commits into from
Nov 11, 2024
Merged

Conversation

CalebHeydon
Copy link
Contributor

@CalebHeydon CalebHeydon commented Nov 10, 2024

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.

image

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.
    image
  • 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.
    image
  • 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

Copy link

cla-bot bot commented Nov 10, 2024

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'.

@CalebHeydon
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 10, 2024
Copy link

cla-bot bot commented Nov 10, 2024

The cla-bot has been summoned, and re-checked this pull request!

@zed-industries-bot
Copy link

zed-industries-bot commented Nov 10, 2024

Messages
📖

This PR includes links to the following GitHub Issues: #15309
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against b9b8dae

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@@ -33,11 +33,16 @@ impl KeyContext {
let mut context = Self::default();
#[cfg(target_os = "macos")]
context.set("os", "macos");
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
context.set("os", "linux");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and another place below with Self::Linux looks quite odd, so welcome to fix in in the future PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SomeoneToIgnore SomeoneToIgnore self-assigned this Nov 11, 2024
@SomeoneToIgnore SomeoneToIgnore merged commit a47759f into zed-industries:main Nov 11, 2024
11 checks passed
@bsdlme
Copy link

bsdlme commented Nov 22, 2024

  • 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.

sh -l Option was added to FreeBSD HEAD this week: https://cgit.freebsd.org/src/commit/?id=65f5dd42f11cdcb7716e6cdd09fac2314c144c1f

MFC'ed after a week unfortunately it won't land in the upcoming 14.2-RELEASE. Until then, you can use /usr/local/bin/bash -l.

@chiefMarlin
Copy link

Hey,
Great job on the PR!
Are there any instructions on how it can be used at this moment ?

Thanks

@christianbaptista
Copy link

christianbaptista commented Jan 16, 2025

I have mini gist with basic to install.

@chiefMarlin
Copy link

I have mini gist with basic to install.

Thats perfect! i will try it

@chiefMarlin
Copy link

I had tried building on FreeBSD 15, following these instructions

pkg install -y ca_root_nss protobuf cmake alsa-lib
git clone https://github.com/zed-industries/zed.git && cd zed
export RUSTFLAGS="-C link-dead-code"
cargo build --release

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

error: failed to run custom build command for `webrtc-sys v0.3.5 (https://github.com/zed-industries/livekit-rust-sdks?rev=060964da10574cd9bf06463a53bf6e0769c5c45e#060964da)`

Caused by:
  process didn't exit successfully: `/home/q/zed/target/release/build/webrtc-sys-acfb0aa9d2637c60/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LK_DEBUG_WEBRTC
  cargo:rerun-if-env-changed=LK_CUSTOM_WEBRTC
  cargo:CXXBRIDGE_PREFIX=webrtc-sys
  cargo:CXXBRIDGE_DIR0=/home/q/zed/target/release/build/webrtc-sys-15803e940b18f682/out/cxxbridge/include
  cargo:CXXBRIDGE_DIR1=/home/q/zed/target/release/build/webrtc-sys-15803e940b18f682/out/cxxbridge/crate

  --- stderr

  CXX include path:
    /home/q/zed/target/release/build/webrtc-sys-15803e940b18f682/out/cxxbridge/include
    /home/q/zed/target/release/build/webrtc-sys-15803e940b18f682/out/cxxbridge/crate
  thread 'main' panicked at /home/q/.cargo/git/checkouts/livekit-rust-sdks-171a3090be725d50/060964d/webrtc-sys/build.rs:85:45:
  called `Result::unwrap()` on an `Err` value: "failed to download webrtc from https://github.com/livekit/client-sdk-rust/releases/download/webrtc-dac8015-6/webrtc-freebsd-x64-release.zip: 404 Not Found"
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@christianbaptista
Copy link

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.
zed-freebsd
I'm sorry per my dwm vanilla...

@chiefMarlin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants