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

CI: Add step to test if SDK compiles with latest dependencies #971

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

ok300
Copy link
Contributor

@ok300 ok300 commented May 10, 2024

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)

@ok300 ok300 force-pushed the ok300-add-ci-check-rust-compilation branch 4 times, most recently from bc3a57a to 5ee6fbe Compare May 10, 2024 14:51
@ok300 ok300 self-assigned this Jun 19, 2024
@ok300 ok300 changed the title [Draft] CI: Test if SDK compiles with latest dependencies CI: Add step to test if SDK compiles with latest dependencies Jun 20, 2024
Copy link
Collaborator

@dangeross dangeross left a comment

Choose a reason for hiding this comment

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

Looks good. Seem to be catching the issue from yesterday

@ok300 ok300 changed the base branch from main to ok300-bump-gl-client June 20, 2024 10:13
@ok300 ok300 force-pushed the ok300-add-ci-check-rust-compilation branch from 8c0a466 to 698a902 Compare June 20, 2024 10:17
@ok300
Copy link
Contributor Author

ok300 commented Jun 20, 2024

Rebased on #1014 to check if it sees that fix as valid.

Copy link
Member

@roeierez roeierez left a comment

Choose a reason for hiding this comment

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

One question

.github/workflows/main.yml Show resolved Hide resolved
Base automatically changed from ok300-bump-gl-client to main June 20, 2024 10:55
@ok300 ok300 merged commit bb4ec0b into main Jun 20, 2024
8 checks passed
@ok300 ok300 deleted the ok300-add-ci-check-rust-compilation branch June 20, 2024 11:00
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.

3 participants