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:
./:
bin
./bin:
api
./bin/api:
Cargo.lock
Cargo.toml
src
./bin/api/src:
main.rs
./:
bin
./bin:
api
./bin/api:
Cargo.lock
Cargo.toml
src
./bin/api/src:
main.rs
No binaries here.
12 Replies
Percy
Percy•2y ago
Project ID: bbe995ee-c6df-4d23-b96f-15f189f8d8a9
gemcoder (old)
gemcoder (old)OP•2y ago
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!
Brody
Brody•2y ago
erikh would, i dont know rust
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Brody
Brody•2y ago
id also just like to ask, whats wrong with the default way nixpacks would build and start your rust app?
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Brody
Brody•2y ago
im sure you will get to know it in time 😉
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
gemcoder (old)
gemcoder (old)OP•2y ago
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?
gemcoder (old)
gemcoder (old)OP•2y ago
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.
gemcoder (old)
gemcoder (old)OP•2y ago
This is what I get
gemcoder (old)
gemcoder (old)OP•2y ago
@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
Want results from more Discord servers?
Add your server