Skip to content
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

Updated aws_lambda_events dependency #541

Merged
merged 1 commit into from Oct 11, 2022
Merged

Updated aws_lambda_events dependency #541

merged 1 commit into from Oct 11, 2022

Conversation

dcormier
Copy link
Contributor

@dcormier dcormier commented Oct 7, 2022

Updated aws_lambda_events to latest minor version.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

Copy link
Contributor

@calavera calavera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this will cause compilation errors. It's due to the QueryMap dependency. Which is pretty much my fault 😭

You can test this by creating a new project with cargo lambda new --http test-deps, and changing the lambda_http dependency to point to this code. You'll get the following errors:

error[E0308]: mismatched types
   --> /home/david/src/aws-lambda-rust-runtime/lambda-http/src/request.rs:160:19
    |
160 |             Some((&ag.multi_value_query_string_parameters, &ag.query_string_parameters)),
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `query_map::QueryMap`, found struct `aws_lambda_events::query_map::QueryMap`
    |
    = note: expected reference `&query_map::QueryMap`
               found reference `&aws_lambda_events::query_map::QueryMap`
    = note: perhaps two different versions of crate `query_map` are being used?

error[E0308]: mismatched types
   --> /home/david/src/aws-lambda-rust-runtime/lambda-http/src/request.rs:160:60
    |
160 |             Some((&ag.multi_value_query_string_parameters, &ag.query_string_parameters)),
    |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `query_map::QueryMap`, found struct `aws_lambda_events::query_map::QueryMap`
    |
    = note: expected reference `&query_map::QueryMap`
               found reference `&aws_lambda_events::query_map::QueryMap`
    = note: perhaps two different versions of crate `query_map` are being used?

error[E0308]: mismatched types
   --> /home/david/src/aws-lambda-rust-runtime/lambda-http/src/request.rs:168:17
    |
168 |                 ag.query_string_parameters
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `query_map::QueryMap`, found struct `aws_lambda_events::query_map::QueryMap`
    |
    = note: perhaps two different versions of crate `query_map` are being used?

error[E0308]: mismatched types
   --> /home/david/src/aws-lambda-rust-runtime/lambda-http/src/request.rs:170:17
    |
170 |                 ag.multi_value_query_string_parameters
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `query_map::QueryMap`, found struct `aws_lambda_events::query_map::QueryMap`
    |
    = note: perhaps two different versions of crate `query_map` are being used?

For more information about this error, try `rustc --explain E0308`.
warning: `lambda_http` (lib) generated 1 warning
error: could not compile `lambda_http` due to 4 previous errors; 1 warning emitted
warning: build failed, waiting for other jobs to finish...

Comment on lines -82 to -85
#[cfg(feature = "alb")]
pub use aws_lambda_events::alb;
#[cfg(any(feature = "apigw_rest", feature = "apigw_http", feature = "apigw_websockets"))]
pub use aws_lambda_events::apigw;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These reexports were only committed a couple of days ago (#542), and haven't yet been released.

@dcormier
Copy link
Contributor Author

Huh. I could've sworn I ran the tests (which also fail) on my branch before I opened this PR. I apologize for not catching that.

I thought I had an easy fix for this since my PR to have aws_lambda_events reexport that crate was merged. And taking advantage of that does solve much of this problem.

But (of course), this crate uses the url-query feature flag in query_map, which aws_lambda_events doesn't. I could ask aws_lambda_events to add that as an optional feature flag, but that seems like too much.

I got it to work with a little more massaging.

@calavera
Copy link
Contributor

But (of course), this crate uses the url-query feature flag in query_map, which aws_lambda_events doesn't. I could ask aws_lambda_events to add that as an optional feature flag, but that seems like too much.

Let's add that feature there, so this codebase doesn't have to handle that. I'm going to have to approve both PRs anyways 🤣

@calavera
Copy link
Contributor

@dcormier I've released a new version of the events crate with the feature flag, so we should be able to remove that extra code from here now: https://crates.io/crates/aws-lambda-events/0.7.2

@calavera
Copy link
Contributor

mmm either GitHub Actions is having issues today, or they made any change that breaks our workflows 😞

@calavera
Copy link
Contributor

Oh, it looks like aws_lambda_events doesn't support Rust 1.58. I'm going to open a PR to update the MSRV to 1.61 to follow the convention that we have in the Rust SDK.

@calavera
Copy link
Contributor

@dcormier I've merged #544, if you rebase your branch with main, the tests should pass

@calavera calavera merged commit bab0235 into awslabs:main Oct 11, 2022
@dcormier dcormier deleted the dc/deps branch October 11, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants