Rust Project fails building-stage
See attached textfiles. I have no Idea what to do about this.
47 Replies
Can you try setting the variables
I tried and it failed in a similar way:
Can you share the project id
Is the project id the same thing as the service-name?
Just a url to the deployment will work
voteondate-production.up.railway.app
I mean the link to the railway deployment. Where the logs are
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Oh appologizes. It should be this variable instead
NIXPACKS_APT_PKGS
It comes from https://nixpacks.com/docs/config#environment-variables
Configuration | Nixpacks
App source + Nix packages + Docker = Image
Instead of
NIXPACKS_APT_PACKAGES
? Should I also set it to "libpq-dev
"?Yup
Okay, brb
Same error, unfortunately.
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
I'm new to railway, so this might very well be an issue with my setup.
No this is indeed an issue with us. The problem is that the postgres binaries are not available at build time. I think I have the configuration you need though. Can you set the variables to
(so just replacing the apt variable to the pkgs one)
Will try it out!
Hmm I see it is the same error
Yup
What does your
Cargo.toml
look like?
This is the source-code: https://gitlab.com/Glitchy-Tozier/voteon.date
thank you
I was just able to deploy that repo no problem so I have a feeling it is your cache. Unfortunatley this experience isn't great on Railway at the moment. Can you creating a new service and deploying to that with the same variables that you have now
Will do.
Should I keep the environment variables?
Yes keep both of the variables
Nice, it seems to have worked!
nice!
Now I just need to figure out the other errors 😅
Anyway, thank you for your amazing help! 🙂
Hmm I see that there is an error looking for
../frontend
. Since you have set the root directory to backend
, that is the only directory that will be available. To work with the root directory the "frontend" should be a subdirectory of the root directoryRegarding folder-structure (there's some other errors too, these are 100% my fault):
As you may have seen I have a structure like this:
To make the server run I need to first build the frontend via
npm install && npm run build
.
Then I need to run the backend to serve the files that got created in /frontend/build
.All that exists at the moment is the backend-part, which is this block:
Do you have any hints on how to connect another block where I can have the frontend get built?
Hm
That is a workflow that isn't that well supported yet. Currently only single language projects are supported with Nixpacks unfortunatley. That is something we are actively working on (in fact I will use this repo as a test case).
However, you may need a Dockerfile to get support for the Node and Rust environments at the moment
That is unfortunate, I was trying to avoid creating dockerfiles.
Do you know any good tutorials on how I may approach building it?
I was trying to avoid creating dockerfiles.I feel the same way :/ Hence why we are building Nixpacks. It is just not 100% there yet
Do you know any good tutorials on how I may approach building it?We have a wasm example that uses both Rust and node. You can check it out here https://github.com/railwayapp/starters/blob/master/examples/rust-wasm/Dockerfile You should be able to ignore all the wasm-pack stuff. And may want to install a newer version of node (the example uses 14)
Thank you, I'll try to play around with it!
Do I have to worry about linking the database or will this keep working?
If you want the
DATABASE_URL
available at build time then you need to have ARG DATABASE_URL
somewhere in the Dockerfile. But if it is just needed at runtime then you don't need to do anything.
Thank you for your patience on this. This is indeed a use case we want to support!Hope you eventually get it working! 🙂
Any estimations on when this use-case might get supported?
I don't want to make any promises, but optimistically within the next 2 weeks. But again, no promises
Alright, thank you and good luck 🙂
https://railway.app/changelog/2022-09-09#configurable-build-command
Does this happen to be the new functionality or are "Configurable Build Command" and "Experimental nixpacks.toml Support" something else?
Railway
Changelog #0098
Better Free Plan, Configurable Build Command, nixpacks.toml Support, and Better Java Support
They are slightly different. Nixpacks.toml support will eventually allow for defining multiple languages for a single app, but that has not been implemented yet
But it is a step in the right direction
Sorry for bothering you again, but is this feature implemented as of yet?
I haven't kept up to date with the change-logs.
Yes it has, here are the docs https://docs.railway.app/deploy/config-as-code
@guess_wh0
Thank you!
@Adam So I've finally gotten around to looking at the docs.
My initial issue was not being able to use multiple languages for a single app. I wasn't able to find a solution to that issue in the docs. Am I missing something?
^ (this is the workflow I'm going for)
I think what I'm looking for might be this? https://docs.railway.app/deploy/builds#build-providers
What you're looking for is this: https://nixpacks.com/docs/configuration/file
Just set multiple providers
Configuration File Reference | Nixpacks
App source + Nix packages + Docker = Image