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 --locked when installing the server in the Docker image. #61

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

plietar
Copy link
Member

@plietar plietar commented Apr 3, 2024

Same problem we had in the orderly2 CI. 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.

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
@plietar plietar requested a review from richfitz April 3, 2024 15:39
@richfitz richfitz merged commit 21e0cef into main Apr 3, 2024
17 checks passed
@plietar plietar deleted the cargo-locked branch April 3, 2024 16: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.

2 participants