Hard Crash Deploying Rust App

Hello, I’m hoping to deploy our new Rust app to Fly.io, but I am getting a hard crash while its running cargo build --release in our Dockerfile. The fault shown is #SIGSEV: Invalid memory reference, and then it hangs waiting for the other tasks to quit until I hit Ctrl C I tried to get the build logs but the cli always says I am missing one of the required arguments. Here is the output shown on the terminal: Vidette Fly deployment failure · GitHub

and here is the Dockerfile used:

and here is the directory structure:

and here are the two Cargo.toml files for the two members of the workspace package

This builds as expected in docker on my local machine, and I am at a loss to explain why it fails on Fly. Fly support asked me to post this here, hopefully someone can shed more light on it.

Hey there.

I’ve taken a quick look and I see this is building w/ your local Docker.

What OS and architecture are you using?

You may try flyctl deploy --remote-only to build it in a remote builder we’ll provision automatically (free of charge) for you.

1 Like

Hi! I’m doing this on my Apple M1 Macbook Pro. I Now that you mention it, I don’t know if that makes fly very happy. However, I can build this using docker outside of Fly with no issue.

I’m trying the remote option you suggested. I’ll let you know how it goes.

How big is the build context with normal docker?

That was my bad, The .dockerignore got deleted somehow and it was trying to push the 1G+ target folder.

Anyway, the remote option builds normally and then the app fails to start due to some entirely expected issues with config I haven’t set up yet.

So it seems like I can deploy now, but that flyctl does not like the M1. Thank you!

Oh okay glad it wasn’t a bug :smiley:

Docker on the M1 emulates amd64 with qemu, and unfortunately a lot of software still can’t build on it. Remote builders are fly apps running dockerd that flyctl connects to which avoids the issue entirely. We’re thinking about defaulting to remote builders on M1 because of this.

1 Like

It’d be great to have a warning pop up in flyctl, even if you don’t change the default. Would have resolved this pretty quickly :slight_smile:

1 Like