Help building gemserv please

I know nothing about rust, but am trying to get gemserv to work on my aws instance.

When I try to build it with 'cargo build --release', I get a bunch of openssl -related errors:

   Compiling openssl-sys v0.9.60
   Compiling mio-uds v0.6.8
error: failed to run custom build command for `openssl-sys v0.9.60`

Caused by:
  process didn't exit successfully: `/home/stack/src/gemserv/target/release/build/openssl-sys-b16be9f45b19caff/build-script-main` (exit status: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR = /usr/local/ssl

  --- stderr

  thread 'main' panicked at /home/stack/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/openssl-sys-0.9.60/build/main.rs:72:9:
  OpenSSL include directory does not exist: /usr/local/ssl/include
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

I tried everything I can think of as far as the environment variables go, /usr/local/ssl was just the latest attempt...

I am on ubuntu 24.04 with latest openssl from the distro, btw. I did try to hand-compile that monstrosity, but went back to stock.

Any help is appreciated.

Posted in: s/rust_software
🚀 stack

Sep 01 · 4 months ago

4 Comments ↓

👻 ps · Sep 01 at 18:02:

I have no idea what is it, just tried to build on Fedora 42 and have another libssl-dev issue.

this codebase is 4 years old, at least it could require deprecated clang bindings,

why not to use Agate (Rust) instead or just gmid (clang) - both are working solutions..

🚀 Tomi · Sep 02 at 13:23:

The issue is pretty self-explanatory, you are missing the /usr/local/ssl/include directory.

Most distro ships devel or headers packages separately so you don't waste space if you aren't compiling stuff yourself. You are probably just missing an openssl-devel package. Naming may be different depending on distro.

🚀 stack [OP] · Sep 02 at 13:27:

I installed and reinstalled openssl-dev (Ubuntu), and even hand- compiled openssl. It took forever and I was still getting variations of similar errors. I tried to create symlinks to match what I could deduce gemserv wants but never got it right.

😺 vzsg · Sep 02 at 17:12:

I think you're getting these errors because of the archaic versions of dependencies locked in the project.

For example, openssl 0.10.32 was released in 2020, and it only supports OpenSSL versions 1.0.1-1.1.1, which have been removed from circulation long ago.

It might be possible to upgrade everything to get it running on modern systems. But there's a quick and dirty and insecure solution: you can tell Cargo to vendor its own openssl by editing Cargo.toml, like:

 [dependencies]
 tokio = { version = "0.2", features = [ "time", "fs", "process", "net", "io-util", "rt-threaded" ] }
-openssl = "0.10"
+openssl = { version = "0.10", features = ["vendored"] }

At least, that made it compile for me. It started complaining about a configuration file.

PS: I don't know much about Rust either :)

Also, hi everyone.

---

Actually, updating dependencies seems to work fine. Ignore what I said in the previous section, and instead try running "cargo update" followed by "cargo run".

The new openssl dep will be compatible with 3.x on Ubuntu.