#Rust server fails on railway

36 messages · Page 1 of 1 (latest)

jaunty violet
#

I'm trying to host my rust server on railway I use this guy's template https://railway.app/template/4lz789, when project build main panics and throws error about OPENSSL here is full error

#13 1.381   --- stderr
#13 1.381   thread 'main' panicked at '
#13 1.381
#13 1.381   Could not find directory of OpenSSL installation, and this `-sys` crate cannot
#13 1.381   proceed without this knowledge. If OpenSSL is installed and this crate had
#13 1.381   trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
#13 1.381   compilation process.
#13 1.381
#13 1.381   Make sure you also have the development packages of openssl installed.
#13 1.381   For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
#13 1.381
#13 1.381   If you're in a situation where you think the directory *should* be found
#13 1.381   automatically, please open a bug at https://github.com/sfackler/rust-openssl
#13 1.381   and include information about your system as well as this message.
#13 1.381
#13 1.381   $HOST = x86_64-unknown-linux-gnu
#13 1.381   $TARGET = x86_64-unknown-linux-musl
#13 1.381   openssl-sys = 0.9.90

how can I fix that issue?

ruby iceBOT
#

Project ID: e5ef3329-8973-45aa-85cf-12d7e6349ff7

jaunty violet
jaunty violet
#

project id: fe64c2e8-8097-4844-aa29-e89674a68409

steep belfry
#

try adding a nixpacks.toml file with this in it

[phases.setup]
aptPkgs = ["...", "libssl-dev"]
steep belfry
#

show me your nixpacks.toml file please

jaunty violet
steep belfry
#

what's the default root directory for that template?

jaunty violet
#

/app

#

right now I moved nixpacks.toml in app

#

project is building

#

still failed

#14 8.392 error: failed to run custom build command for `openssl-sys v0.9.90`
#
#14 8.393   --- stderr
#14 8.393   thread 'main' panicked at '
#14 8.393
#14 8.393   Could not find directory of OpenSSL installation, and this `-sys` crate cannot
#14 8.393   proceed without this knowledge. If OpenSSL is installed and this crate had
#14 8.393   trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
#14 8.393   compilation process.
#14 8.393
#14 8.393   Make sure you also have the development packages of openssl installed.
#14 8.393   For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
#14 8.393
#14 8.393   If you're in a situation where you think the directory *should* be found
#14 8.393   automatically, please open a bug at https://github.com/sfackler/rust-openssl
#14 8.393   and include information about your system as well as this message.
#14 8.393
#14 8.393   $HOST = x86_64-unknown-linux-gnu
#14 8.393   $TARGET = x86_64-unknown-linux-musl
#14 8.393   openssl-sys = 0.9.90
#14 8.393
#14 8.393   ', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/build/find_normal.rs:190:5
#14 8.393   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#14 8.393 warning: build failed, waiting for other jobs to finish...
#

in build logs saw libssl-dev installed

steep belfry
#

okay, I will do some testing later and get back to you

jaunty violet
#

thanks

#

i just hosted same template and it worked

#

but when i make some changes in code

#

it fails

steep belfry
#

you must have added a crate that relies on openssl

#

please provide me a minimal reproducible repo, or there's not much I can do to help, I was under the impression the unmodified template fails to build

jaunty violet
jaunty violet
#

found out reqwest package causes that

steep belfry
#

I would still need a minimal reproducible repo

jaunty violet
#

okay wait

#

here is

#

in Cargo.toml if i remove reqwest

#

it builds well

steep belfry
#

thanks, I will do some tests later

jaunty violet
#

I just fixed it by adding openssl package in cargo

#
openssl = {version = "0.10.55", features = ["vendored"]}
twilit arrowBOT