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

Use lockfile when installing outpack_server in CI. #134

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Conversation

plietar
Copy link
Member

@plietar plietar commented Mar 25, 2024

Somewhere, something in the dependency tree of outpack_server something changes and caused the build to fail, which broke the orderly2 CI.

This is the kind of thing lock files are supposed to prevent, by pinning to the same package versions used in outpack_server's own CI, which should make the build reproducible. However, quite surprisingly, cargo install ignores the lock file by default and pulls the latest compatible version of dependencies. Passing the --locked argument should prevent this from happening.

I haven't investigated the underlying build failure much yet, but seems like an issue with a missing cargo feature flag.

Somewhere, something in the dependency tree of outpack_server something
changes and caused the build to fail, which broke the orderly2 CI.

This is the kind of thing lock files are supposed to prevent, by pinning
to the same package versions used in outpack_server's own CI, which
should make the build reproducible. However, quite surprisingly,
`cargo install` ignores the lock file by default and pulls the latest
compatible version of dependencies. Passing the `--locked` argument
should prevent this from happening.

I haven't investigated the underlying build failure much yet, but seems
like an issue with a missing cargo feature flag.
@plietar plietar requested a review from richfitz March 25, 2024 14:53
@plietar
Copy link
Member Author

plietar commented Mar 25, 2024

Previous CI failure: https://github.com/mrc-ide/orderly2/actions/runs/8421643492/job/23059035785?pr=132

In the logs it says Downloaded tokio v1.36.0, whereas the outpack_server lockfile has it set to 1.35.1: https://github.com/mrc-ide/outpack_server/blob/dbf23fb4f6a84cc326efd48c1011816a181e5dfd/Cargo.lock#L2174. I don't think tokio is the actual dependency at fault here (1.36.0 was released over a months ago, and this issue only started today), just the first one I noticed that had a version mismatch,

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (9222c8f) to head (d555120).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #134   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           40        40           
  Lines         3671      3671           
=========================================
  Hits          3671      3671           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richfitz richfitz merged commit 5e11123 into main Mar 26, 2024
11 checks passed
plietar added a commit to mrc-ide/outpack_server that referenced this pull request Apr 3, 2024
Same problem we had in [the orderly2 CI][mrc-ide/orderly2#134]. By
default `cargo install` ignores the lockfile and uses the latest
compatible version of dependencies available on `crates.io`. Something
changed in our dependency tree, and the build fails if the `Cargo.lock`
isn't used, breaking our Docker image build.

Regardless of this particular failure, I think we should always be using
the lockfile when assembling the Docker image. The lockfile represents
the set of versions that were used when running the test suite,
therefore this should be the versions we run in production. In a way we
got lucky that this change broke the build, rather than cause a change
in behaviour that might make the server misbehave in a way that the test
suite would have caught.

[mrc-ide/orderly2#134]: mrc-ide/orderly2#134
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.

2 participants