Not able to deploy Rust application. Rocket Template
I'm using
cargo build --release
to build and then cargo run --binary api
but it does not product any binary for the deploy command.
Whenever I call ls -R ./
it will return:
No binaries here.12 Replies
Project ID:
bbe995ee-c6df-4d23-b96f-15f189f8d8a9
Seems like binaries not being moved into deploy stage
I simply need to run deploy as
cargo build --release
and then run cargo run --bin api
@erikh @Brody who would be the best people to help with this? Thank you!erikh would, i dont know rust
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
id also just like to ask, whats wrong with the default way nixpacks would build and start your rust app?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
im sure you will get to know it in time 😉
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I have a workspace setup and I have multiple binaries, rust suggest to put binaries under
bin
folder
NIXPACKS_NO_MUSL=1
solved the issue, no idea why tho
9a3dfee5-c7f3-46c4-b704-cb67b7289326
and bbe995ee-c6df-4d23-b96f-15f189f8d8a9
project ids, I was not able to deploy yet anything from the cargo workspace, can you take a look?https://github.com/gemwalletcom/api here is the code, there is two binaries, client and deamon
GitHub
GitHub - gemwalletcom/api
Contribute to gemwalletcom/api development by creating an account on GitHub.
This is what I get
@erikh @Brody can you please help here to figure it out? Quite confident something wrong with nixpack setup. I also tried to set
NIXPACKS_RUST_BIN
and NIXPACKS_CARGO_WORKSPACE
ERROR: failed to solve: process "/bin/bash -ol pipefail -c cp target/release/client bin" did not complete successfully: exit code: 1
Seems like it's not able to move the binary to the bin folder
This is pretty standard setup for cargo workspace with multiple binaries as api and worker
Solution was not to put binary into /bin folder and keep them in the root, because it had conflict with the folder and the name of the binary