CI: Add step to test if SDK compiles with latest dependencies #971
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new CI step that creates a new plain Rust project, adds the SDK as single dependency and tries to compile it. This tests whether the SDK compiles with the latest version of the dependencies that can be updated.
TLDR: When this CI step fails, it's an early warning signal that allows us to become aware of and solve issues such as
before customers report them.
Our checked-in Cargo.lock contains the specific combination of all direct and transitive dependency versions. This dependency tree snapshot was tested against during development and is what we release.
However, when integrating the SDK in a new Rust project, Cargo not use our Cargo.lock. Instead, it will try to generate a new Cargo.lock based on our (and our dependencies') Cargo.toml files. This means that, where a dependency version range is used in a Cargo.toml, Cargo will try to upgrade it to the latest matching version. If this happens, this new dependency version may even result in the whole project failing to compile. In that case, the only solution is to manually pin the problematic dependencies to the last known good versions, in the application's Cargo.toml.
Since this is the situation new projects are faced with when adding the SDK as a Rust dependency, we simulate it here to get an early warning signal, should any newer dependency cause it to fail to compile.
See discussion at #969 (comment)