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

Compile-time check for a smithy-rs server relying on incompatible versions of lambda_http #2686

Open
david-perez opened this issue May 9, 2023 · 0 comments
Labels
server Rust server SDK

Comments

@david-perez
Copy link
Contributor

If a smithy-rs server application depends on lambda_http 0.8.0, but aws-smithy-http-server depends on lambda_http 0.7.0, requests become unroutable. See #2676.

In general, we cannot guarantee that a smithy-rs server application will work correctly if it depends on a version of lambda_http that is semver-incompatible with the version used by aws-smithy-http-server. We're palliating this with documentation in #2683, but if developers don't read it, an incompatible setup can cause a hard-to-debug issue.

This ticket tracks possible mechanisms we could use to check this at compile-time, to warn or abort the compile.

One suggestion by @LukeMathWalker is to use cargo metadata / guppy::graph::PackageQuery in a build.rs of the generated server SDK to traverse the dependency graph upwards and detect if the service application reaches a version of lambda_http that is incompatible with a version on which the server SDK depends. A thing to note is that with a build.rs approach, built artifacts of the server SDK may become harder/impossible to cache.

@david-perez david-perez added the server Rust server SDK label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Rust server SDK
Projects
None yet
Development

No branches or pull requests

1 participant