Skip to content
This repository was archived by the owner on Apr 27, 2025. It is now read-only.

This repo does not work anymore with Netlify #2

Closed
clarnx opened this issue Jan 29, 2024 · 6 comments
Closed

This repo does not work anymore with Netlify #2

clarnx opened this issue Jan 29, 2024 · 6 comments

Comments

@clarnx
Copy link

clarnx commented Jan 29, 2024

Saw your video on Youtube and then cloned the repo and deployed on Netlify.
However the repo does not work.
Are there any updates?

@clarnx clarnx changed the title This repo does not work anymore This repo does not work anymore with Netlify Jan 29, 2024
@ChristopherBiscardi
Copy link
Contributor

Unfortunately I'm going to be deprecating this repo as Netlify has not continued support in a substantial way. The examples will be converted to AWS Lambda examples which will work correctly with cargo-lambda: https://www.cargo-lambda.info/

AWS has committed to supporting Rust and their SDKs have hit 1.0 in the last few months -- https://aws.amazon.com/blogs/developer/announcing-general-availability-of-the-aws-sdk-for-rust/ so that's where I'm going to focus my serverless work moving forward.

@clarnx
Copy link
Author

clarnx commented Jan 30, 2024

Thanks for the update. For some funny reason looks like after I deployed this repo with the custom build in the build.sh file previous deployments that worked on Netlify no longer work.
Any reasons why that might be the case?
I even tried the previous repo at https://github.com/netlify/rust-functions-example as a fresh deploy and it did not work.
It was working previously I don't know why it stopped working all of a sudden.
If possible can you investigate this.
Try to deploy this repo and then when it fails try to deploy the working version at https://github.com/netlify/rust-functions-example

Thanks

@ChristopherBiscardi
Copy link
Contributor

Netlify has been changing their environments without really notifying anyone, so its very possible that they did that again and as a result older functions got re-deployed into a non-working environment.

Another big trip up that currently exists is that if you use a recent version of Rust and build in --release mode Netlify's CLI will no longer recognize it because they overfit their binary detection and there is no way to tell Netlify that a binary is, in fact, a function it should upload. You have to pass their heuristics, which are wrong. That issue hasn't been responded to for a few months now though so I don't anticipate it being fixed -- netlify/cli#6168

You can pass the heuristic if you build in debug mode (without the --release flag), but you'll get bigger, slower applications because all of the debug info is included.

@clarnx
Copy link
Author

clarnx commented Jan 30, 2024

Thanks for the information.
I appreciate it.
I guess I have to host my Rust application elsewhere.
Apart from Shuttle-rs what other alternatives would to recommend to host my Rust application based on your experience and ease of access.
Note: I don't want to use AWS lambda.

Thanks.

@ChristopherBiscardi
Copy link
Contributor

I use Fly.io and it works very well and has been stable for me for a while now. You will have to write a Dockerfile, but here's an example one that I've used before (given a project called api).

FROM ubuntu:22.04
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY target/release/api /usr/local/bin/api
WORKDIR /opt
CMD ["api"]

@ChristopherBiscardi
Copy link
Contributor

netlify has semi-officially said they won't be working on the rust support and the relevant issues in the cli repo have been closed without a fix so I'm going to archive this repo and the corresponding workshops and focus on lambda and other platforms in the future.

https://answers.netlify.com/t/roadmap-for-full-rust-support-since-its-been-in-experimental-mode-for-quite-some-time/111836

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants