Skip to content

fix: remove cargo update to preserve Cargo.lock versions - #1320

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/remove-cargo-update
Apr 1, 2026
Merged

fix: remove cargo update to preserve Cargo.lock versions#1320
shunkakinoki merged 1 commit into
mainfrom
fix/remove-cargo-update

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Script builds repos using their locked dependency versions

🤖 Generated with Claude Code


Summary by cubic

Remove cargo update from scripts/update-local-binaries.sh to respect upstream Cargo.lock and avoid unexpected dependency upgrades that can break builds (e.g., digest/sha2 bumps in cass). The script now only runs cargo +nightly build --release for reproducible builds with locked deps.

Written for commit 2ca3d7c. Summary will update on new commits.

cargo update overwrites Cargo.lock with latest semver-compatible
versions, which broke cass by bumping digest/sha2 beyond what the
repo code supports. Just use cargo +nightly with the locked deps.
Copilot AI review requested due to automatic review settings April 1, 2026 08:28
@shunkakinoki
shunkakinoki merged commit 7875799 into main Apr 1, 2026
24 of 26 checks passed
@shunkakinoki
shunkakinoki deleted the fix/remove-cargo-update branch April 1, 2026 08:29
@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7199bc07-e9bc-4495-9bfb-ba8b245cebaa

📥 Commits

Reviewing files that changed from the base of the PR and between ff076dd and 2ca3d7c.

📒 Files selected for processing (1)
  • scripts/update-local-binaries.sh

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Streamlined the local binary build process by removing a redundant build step.

Walkthrough

A Cargo build step in the local binaries update script was simplified by removing the cargo update command, retaining only the cargo +nightly build --release step for determining build success or failure.

Changes

Cohort / File(s) Summary
Build Script Modification
scripts/update-local-binaries.sh
Removed cargo update step from Cargo.toml repository build sequence; script now relies solely on cargo +nightly build --release for success/failure determination.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop and a skip, no update in sight,
Just nightly builds racing through the night,
One step removed, the build runs clean,
Swifter and simpler than it's been!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-cargo-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 1, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Remove cargo update from update-local-binaries.sh to avoid overwriting upstream Cargo.lock.

What changed?

  • update-local-binaries.sh: Removed the cargo update command.
  • update-local-binaries.sh: Maintained cargo +nightly build --release.

Description generated by Mesa. Update settings

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

@mesa-dot-dev mesa-dot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Performed full review of ff076dd...2ca3d7c

Analysis

Stale Repository Vulnerability: The PR respects upstream Cargo.lock files for reproducibility, but there's no mechanism to update local repository checkouts before building. This could perpetuate outdated source code and dependency versions indefinitely, potentially including known security vulnerabilities.

Missing Repository Update Logic: The build script operates on local repositories without visible pre-build update steps (e.g., git pull). Users must manually update repositories or remember to run separate refresh commands, creating a gap between intended reproducibility and actual security maintenance.

Incomplete Documentation of Build Prerequisites: The change assumes users understand they need to manually update repository checkouts, but this dependency isn't documented or enforced in the script itself, risking stale builds without clear guidance.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

0 files reviewed | 1 comments | Edit Agent SettingsRead Docs

fi
elif [ -f "$build_dir/Cargo.toml" ]; then
if (cd "$build_dir" && cargo update 2>&1 && cargo +nightly build --release 2>&1); then
if (cd "$build_dir" && cargo +nightly build --release 2>&1); then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

Removing cargo update preserves upstream dependency versions, which is good for reproducibility. However, this script doesn't appear to pull/update the git repositories before building. Consider adding a git pull or similar mechanism to ensure you're building the latest upstream code, otherwise you may be building stale versions with stale dependencies. This would be particularly important if these repositories receive security updates.

Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#1320
File: scripts/update-local-binaries.sh#L161
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
Removing `cargo update` preserves upstream dependency versions, which is good for reproducibility. However, this script doesn't appear to pull/update the git repositories before building. Consider adding a `git pull` or similar mechanism to ensure you're building the latest upstream code, otherwise you may be building stale versions with stale dependencies. This would be particularly important if these repositories receive security updates.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the scripts/update-local-binaries.sh script to remove the cargo update step when building Rust projects, which helps in maintaining consistent dependency versions. A review comment suggests further improving this by adding the --locked flag to the cargo build command to ensure the build strictly adheres to the Cargo.lock file and fails if it is out of sync.

fi
elif [ -f "$build_dir/Cargo.toml" ]; then
if (cd "$build_dir" && cargo update 2>&1 && cargo +nightly build --release 2>&1); then
if (cd "$build_dir" && cargo +nightly build --release 2>&1); then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To fully adhere to the goal of preserving Cargo.lock versions as stated in the PR title and description, consider adding the --locked flag. This ensures that the build will use the exact dependency versions specified in the lockfile and will fail if the lockfile is out of sync with Cargo.toml, preventing any unintended automatic updates during the build process.

Suggested change
if (cd "$build_dir" && cargo +nightly build --release 2>&1); then
if (cd "$build_dir" && cargo +nightly build --release --locked 2>&1); then

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes cargo update from the local binary build script so it doesn’t overwrite upstream Cargo.lock, while keeping the existing nightly release build behavior.

Changes:

  • Drop cargo update from the Rust build path in update-local-binaries.sh
  • Continue using cargo +nightly build --release for Rust repos

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fi
elif [ -f "$build_dir/Cargo.toml" ]; then
if (cd "$build_dir" && cargo update 2>&1 && cargo +nightly build --release 2>&1); then
if (cd "$build_dir" && cargo +nightly build --release 2>&1); then

Copilot AI Apr 1, 2026

Copy link

Choose a reason for hiding this comment

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

To fully align with the goal of preserving Cargo.lock, consider adding --locked to the cargo build invocation. Without --locked, Cargo can still rewrite the lockfile in some scenarios (e.g., lockfile format normalization, resolver differences, or when the lock is out-of-date), which can leave the repo dirty and undermines the intent of removing cargo update.

Suggested change
if (cd "$build_dir" && cargo +nightly build --release 2>&1); then
if (cd "$build_dir" && cargo +nightly build --release --locked 2>&1); then

Copilot uses AI. Check for mistakes.
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