Skip to content

CI: add --locked for cargo build - #4933

Merged
driftluo merged 1 commit into
nervosnetwork:developfrom
eval-exec:exec/cargo-build-locked
Aug 13, 2025
Merged

CI: add --locked for cargo build#4933
driftluo merged 1 commit into
nervosnetwork:developfrom
eval-exec:exec/cargo-build-locked

Conversation

@eval-exec

@eval-exec eval-exec commented Aug 5, 2025

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Related changes

  • add --locked for all cargo build

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • None

Release note

None: Exclude this PR from the release note.

@eval-exec
eval-exec requested a review from a team as a code owner August 5, 2025 05:16
@eval-exec
eval-exec requested review from doitian and removed request for a team August 5, 2025 05:16
@driftluo

driftluo commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

The cargo.lock file exists, so there is no need to add a --locked command.

@eval-exec

Copy link
Copy Markdown
Collaborator Author

The cargo.lock file exists, so there is no need to add a --locked command.

cargo build --help | grep locked
      --locked                Assert that `Cargo.lock` will remain unchanged

cargo build maybe modify the Cargo.lock's content. If we add --locked, then we can ensure the ckb binary is using the deps version from Cargo.lock

@driftluo

driftluo commented Aug 6, 2025

Copy link
Copy Markdown
Contributor
--locked
           Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios
           arises:

           •   The lock file is missing.

           •   Cargo attempted to change the lock file due to a different dependency resolution.

           It may be used in environments where deterministic builds are desired, such as in CI pipelines.

Cargo build will only modify the version in cargo.lock if it does not exist or there is a dependency problem with the version in lock. This --lock only prevents these two situations. Although I don't think it will happen, it is not a problem.

@driftluo
driftluo added this pull request to the merge queue Aug 13, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 13, 2025
@driftluo
driftluo added this pull request to the merge queue Aug 13, 2025
Merged via the queue into nervosnetwork:develop with commit c24f833 Aug 13, 2025
34 checks passed
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