AWS-SDK + Serverless-Rust plugin :failed to run custom build command for ring v0.16.20 #241
-
Hi, I just wanted to try out the AWS-SDK for Rust with Serverless Framework (with Rust plugin). However, after I added the aws-config and s3 packages into the project, my build is failing. cargo.toml[dependencies]
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.19-alpha", package = "aws-config" }
aws-sdk-s3 = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.19-alpha", package = "aws-sdk-s3" }
tokio = { version = "0.2", features = ["macros"] }
lambda = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/", package="lambda_runtime", branch = "master"}
serde_json = "1.0" use lambda::{handler_fn, Context};
use serde_json::{Value, json};
type Error = Box<dyn std::error::Error + Sync + Send + 'static>;
#[tokio::main]
async fn main() -> Result<(), Error> {
lambda::run(handler_fn(handler)).await?;
Ok(())
}
async fn handler(event: Value, _: Context) -> Result<Value, Error> {
let bucket_name = &event["Records"][0]["s3"]["bucket"]["name"];
let key = &event["Records"][0]["s3"]["object"]["key"];
let result = json!({
"bucket": bucket_name,
"key": key,
});
Ok(result)
} when I try to deploy via If you have any ideas how to solve this, I really appreciate it :) Error messageerror: failed to run custom build command for Caused by: --- stderr Error -------------------------------------------------- Error:
Get Support -------------------------------------------- Your Environment Information --------------------------- |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It looks like #186 has some more information that may be useful. |
Beta Was this translation helpful? Give feedback.
-
I actually addressed this Using the Thanks to @hoffa for letting me know about the newly pushed ARM64 provided.al2 build images in aws/aws-sam-build-images#26 (comment) Comes with a gotcha though... since @nmoutschen is looking into how to address it. His rust serverless demo project bypasses |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
It looks like
ring
, which is a dependency we use for signing requests, is failing to compile. Ring uses C code, and since this is being compiled with musl, it expectsmusl-gcc
to be on the path. I think you need to install the musl gcc compiler into the build environment to solve this.#186 has some more information that may be useful.