-
Notifications
You must be signed in to change notification settings - Fork 361
Failed to compile lambda_http example code #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@davidbarsky would this issue be resolved if the http lambda crate were published today as is independently of the other crates? |
update: seems Currently my workaround is to create a struct similar to |
Sorry for the delay, I’m catching up now. @softprops—maybe? |
I can try some experiments and see |
I cloned repository locally, changed Cargo.toml from lambda-http as follows:
diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml
index e8e6d52..c8b147d 100644
--- a/lambda-http/Cargo.toml
+++ b/lambda-http/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "lambda_http"
-version = "0.1.0"
+version = "0.2.0"
authors = ["Doug Tangren"]
edition = "2018"
description = "Rust API Gateway proxy event interfaces for AWS Lambda"
@@ -20,7 +20,7 @@ http = "0.1"
serde = "^1"
serde_json = "^1"
serde_derive = "^1"
-lambda_runtime = { path = "../lambda-runtime", version = "^0.2" }
+lambda_runtime = "0.2"
tokio = "^0.1"
base64 = "0.10"
failure = "0.1" And then changed my Cargo.toml to reference this version instead of the one in crates.io: diff --git a/Cargo.toml b/Cargo.toml
index 402fef2..e31644e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ actix-web = { optional = true, version = "0.7" }
env_logger = { optional = true, version = "0.6" }
listenfd = { optional = true, version = "0.3"}
lambda_runtime = { optional = true, version = "0.2" }
-lambda_http = { optional = true, version = "0.1" }
+lambda_http = { optional = true, version = "0.2", path = "/home/bburnichon/Github/awslabs/aws-lambda-rust-runtime/lambda-http" }
#lambda_http = { optional = true, git = "https://github.com/awslabs/aws-lambda-rust-runtime" }
simple-error = { optional = true, version = "0.1.13" } I can now compile the example without the error message that @Observer42 obtained. So I would say that publishing crates independently would solve the issue. |
@bburnichon awesome work! I still had the issue mentioned above when depending on the latest git version. I think @bburnichon's trick looks promising: a temporary forced declaration of dependence on the published form of lambda_runtime instead of the latest source. |
@davidbarsky thoughts on trying this to publishing lambda-http with a version dependency on |
that would have a nice side effect of on the next update they all versions end up lining up to 0.3 or whatever they might be |
@davidbarsky sending another ping :) |
@softprops Sorry about the delay—normal work has been a bit much recently. I think that's a good idea—I'll try to get a release out later today. |
Issue seems to have been fixed in release (#103). |
I got below error when building the lambda_http example code
according to issue #87 , I chose to fetch lambda_http crate from git address
the dependencies in Cargo.toml are:
error message:
It will not receive such error If I change the lambda_http version to 0.1.0
But in a more practical project, serde::Deserialize (#87 ) will be introduced, so I cannot choose 0.1.0
Is there any workaround? or is there any example to return the http response via lambda_runtime crate only (I would prefer this way, because
lambda
macro in runtime crate allow custom Error type which implementsFail + LambdaErrorExt + Display
(though still not convenient, i.e. #94 ), whilelambda
in http crate allowHandlerError
only)? Thanks in advanceThe text was updated successfully, but these errors were encountered: