rustdesk / rustdesk-server

RustDesk Server Program
https://rustdesk.com/server
GNU Affero General Public License v3.0
6.74k stars 1.45k forks source link

FreeBSD compatibility #141

Closed BrushXue closed 1 year ago

BrushXue commented 2 years ago

Describe the bug Can't build on FreeBSD

error[E0308]: mismatched types
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/local-ip-address-0.4.4/src/lib.rs:86:22
   |
86 | pub fn local_ip() -> Result<IpAddr, Error> {
   |        --------      ^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
   |        |
   |        implicitly returns `()` as its body has no tail or `return` expression
   |
   = note:   expected enum `Result<IpAddr, Error>`
           found unit type `()`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `local-ip-address` due to previous error
warning: build failed, waiting for other jobs to finish...

Describe the environment TrueNAS 13.0 U2 Jails: FreeBSD 13.1-RELEASE-p3 Rust: 1.63.0

How to Reproduce the bug

pkg install git rust
git clone https://github.com/rustdesk/rustdesk-server.git
cd rustdesk-server/
cargo build --release

Expected behavior

Additional context I have zero knowledge about Rust and I'm not sure if it's a Rust problem or FreeBSD problem.

Notes

paspo commented 1 year ago

Are you creating a jail for TrueNAS?

If not, have you considered enabling Linux Binary Compatibility in FreeBSD ?

(side note: it's not a bug if you're talking about an unsupported platform/architecture)

BrushXue commented 1 year ago

Are you creating a jail for TrueNAS?

If not, have you considered enabling Linux Binary Compatibility in FreeBSD ?

(side note: it's not a bug if you're talking about an unsupported platform/architecture)

I've upgraded to TrueNAS Scale so I can use docker. It's a waste of time to deal with the linux compatibility in FreeBSD.

n-connect commented 1 year ago

Are you creating a jail for TrueNAS? If not, have you considered enabling Linux Binary Compatibility in FreeBSD ? (side note: it's not a bug if you're talking about an unsupported platform/architecture)

I've upgraded to TrueNAS Scale so I can use docker. It's a waste of time to deal with the linux compatibility in FreeBSD.

With merged PR #207 and waiting PR #208 you can run rustdesk server as native service on FreeBSD. Needs less CPU/Mem than and empty running containerd and docker alone. Also it is kind of the only way to run it on FreeBSD, where containers & docker also not trivial to run. Plus this gives you the possibility to run them in jails.

BrushXue commented 1 year ago

I can confirm now it works in jails (TrueNAS CORE)