Rust project fails to build

ultimatedoge5
HOBBY

a year ago

During the build I get the error cargo: command not found. In my nixpacks.toml file rust is given as the provider. Tried to redeploy but it doesn't seem to be working.

0 Replies

ultimatedoge5
HOBBY

a year ago

17da20a5-39a3-45c4-9dc5-073cd4c32640


ultimatedoge5
HOBBY

a year ago

Here are the build logs

1248744464374304841


a year ago

please share the nixpacks.toml file


ultimatedoge5
HOBBY

a year ago

providers = ["rust"]

[phases.setup]
nixPkgs = ["ffmpeg"]

a year ago

what does the providers option in your service settings say? if it doesnt include rust make sure to add it


ultimatedoge5
HOBBY

a year ago

it does include rust


ultimatedoge5
HOBBY

a year ago

it knows that is needs to use cargo

1248750001929060400


a year ago

try deploying into a new service


ultimatedoge5
HOBBY

a year ago

It had everything cached and instantly failed due to the same error


a year ago

try deploying into a new service


ultimatedoge5
HOBBY

a year ago

Thats what I did, I made an another service from the same repo.


a year ago

is rust selected in the providers list in the service settings?


ultimatedoge5
HOBBY

a year ago

Yes it is


a year ago

can you temporarily remove your nixpacks.toml file?


ultimatedoge5
HOBBY

a year ago

It deployed successfully


a year ago

let's see the build table now?


ultimatedoge5
HOBBY

a year ago

1249631860171079700


ultimatedoge5
HOBBY

a year ago

Now it includes the compilers


a year ago

now use this nixpacks.toml file instead -

[phases.setup]
    nixPkgs = ["...", "ffmpeg"]

ultimatedoge5
HOBBY

a year ago

Oh, I somehow missed it in the docs that without the ... it discards the auto-detected packages


ultimatedoge5
HOBBY

a year ago

It deployed with ffmpeg


ultimatedoge5
HOBBY

a year ago

Thanks for the help!


a year ago

hey I missed that too when you sent it


ultimatedoge5
HOBBY

a year ago

Okay apparently this is not the end of my issues… I can see in the logs that ffmpeg being installed, but I guess the binary is not in the PATH? My code can't spawn the ffmpeg process, it says that there is no such file. For testing I tried to run a which ffmpeg but it doesn't return anything. Tried installing it via aptPkgs instead of nixPkgs but the issue still persists.


a year ago

well that means it's time to move to a Dockerfile


a year ago

And don't say you don't know how, if you know rust you can figure out a Dockerfile


ultimatedoge5
HOBBY

a year ago

I'll try to cook up something then, thanks for the idea


ultimatedoge5
HOBBY

a year ago

Got my Dockerfile up and running and everything seems to work, including the ffmpeg. Thanks once again.


a year ago

I keep telling everyone, Dockerfile is the way to go, glad it worked for you too!


Rust project fails to build - Railway Help Station