meta: BSD support #785
Labels
No labels
Blocked
Bug
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
To-Merge
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
7 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity#785
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
BSD support in continuwuity, carried over from conduwuit, is quite poor, requiring some manual labour to get a working binary.
This issue should be used to discuss improvements and issues regarding building for and running continuwuity on BSD platforms.
Currently, a cargo build --release results in segfault on launch with this:
so perhaps making jemalloc optional somehow on non-linux platforms would be good. I don't know what the correct approach is here, though.
Rust has the ability to set different default features and dependencies per platform in Cargo.toml, this should be a relatively simple fix for whoever gets around to it.
I'll get on this tomorrow, unless someone beats me to it
Compiled it yesterday (and since rc3 I guess) under FreeBSD with
cargo build --release --timings --no-default-features --features=sentry_telemetry,gzip_compression,zstd_compression,brotli_compression,media_thumbnail,release_max_log_level,element_hacks,url_previewWithout any issues. It was suggested by someone in the conduwuit channel back then.
Yup, it was probably me, my current command is
(removes sentry, adds blur hashing feature)
(for now sentry doesn't do anything by default, so unless you have your own endpoint setup for it there's not much point in enabling it)
I also had
<jemalloc>: option background_thread currently supports pthread only, found this bug and was able to avoid the SEGFAULT by running continuwuation with the environment variableMALLOC_CONFset:works for me :)
Working on OpenBSD (VM) currently :) sofar haven't managed to compile c10y yet due to missing libraries and library static builds error-ing; earlier I managed to compile necessary clang libs (both static and shared).
To sum up what I have done sofar:
LLVM_DIR=/usr/lib(becauseclang-syscomplains about not being able to find them, even thoughllvm-config --libdiris a thing, not to mention casually ignoring statically built clang library)After that, I have gotten stuck on RocksDB undefined references errors sofar. I have added the files for further details :3c
Appending bindgen-static to cargo commandline didn't really change anything significant but yeah...
Note to anyone who plans to spin OpenBSD up: Make sure that your account is part of staff, and be able to manipulate ulimit, since the set ulimit for memory is genuinely small, so if you encounter out of memory issues, make sure to change that up like for example by bumping up ulimit with
ulimit -d yournumhere, otherwise like building llvm-project won't workheck yeah, awoOOOoOo!! I'm actually compiling continuwuity properly now that I've compiled llvm-project libs natively and copied final shared objects to /usr/lib, no undefined symbols errors sofar, and yay, it compiled with no errors!!!
.../conduwuit -hworks under OpenBSD :) I'll drop text files soon along with commandline that I've used to get it working, and eventually I'll do another double-check to see whether I can exclude static libs completely as that was the biggest issue I've had sofar, even compiling rocksdb would fail so it seems like having llvm-project be compiled only might be the viable solution.Turns out, adding
bindgen-runtimeto build commandline did make a difference.here are things i've noted :) hopefully I'll test it soon!
Okay so yeah, after a lot of learning and riding the pain train, I've found out the shortest and efficient path to get continuwuity working under OpenBSD :3c
essentially, a big ! when it comes to OpenBSD is that one's actual stuff to use for development are in /usr/local/*, not /usr... (where super duper serious system stuff are that are not meant to be directly handled with) I mean, basically genuinely distinct from how Linux distributions do file hierarchy, anyway.
So after lots of tinkering around to get a paw of OpenBSD, for any future contributors and testers, minimally you will need
git rust llvm, I think any of the three LLVM versions you'll be choosing from for current OpenBSD (7.8 as of 16.11.2025) should work fine!Before using cargo, make sure to export
LLVM_DIR=$(llvm-config-* --libdir)and despite not knowing the analogue,LIBCLANG_PATH=/usr/local/llvm*/lib/libclang.so.0.0. Also, setulimit -dto be much higher like mentioned above!Since jemalloc refuses to compile with --feature full, as well as
bindgen-staticnot working also, the current working commandline is based on one by Aranje, with timing removed andbindgen-runtimemade explicit.cargo build --release --no-default-features --features=gzip_compression,zstd_compression,brotli_compression,media_thumbnail,release_max_log_level,element_hacks,url_preview,blurhashing,bindgen-runtimeAs for how the newly compiled OpenBSD continuwuity fares, I can't say much other than it being able output help and require configuration file, haven't tested it with Complement yet either, so feel free to continue from where I left off and correct me on what I may have gotten wrong!
(my reference ulimit is
ulimit -d 8388608on an 8GB RAM system)