Skip to content

rust: prevent stale Cargo.lock changing Cargo.lock.in - v1 - #16754

Open
jufajardini wants to merge 1 commit into
OISF:mainfrom
jufajardini:fix-cargo-lock-reverts/v1
Open

jufajardini wants to merge 1 commit into
OISF:mainfrom
jufajardini:fix-cargo-lock-reverts/v1

Conversation

@jufajardini

Copy link
Copy Markdown
Contributor

rust/Cargo.lock is generated from Cargo.lock.in by configure, but if Cargo.lock.in is changed and configure isn't re-run, nothing regenerates the Cargo.lock file. The build then uses the stale lock, and the copy-back added in 0e65ccc writes it over the committed Cargo.lock.in.

This can lead to suricata-verify test failures, as updated dependency versions aren't used, and to the reverted Cargo.lock.in being committed by mistake.

Make Cargo.lock a prerequisite of all-local so it is regenerated when Cargo.lock.in is newer, and preserve its timestamp on copy-back, so this doesn't happen on every build.

Ticket: 9465

Link to ticket: https://redmine.openinfosecfoundation.org/issues/9465

Describe changes:

  • Make Cargo.lock a prerequisite of all-local so it is regenerated when Cargo.lock.in is newer
  • preserve its timestamp on copy-back, so this doesn't happen on every build

rust/Cargo.lock is generated from Cargo.lock.in by configure, but
if Cargo.lock.in is changed and configure isn't re-run, nothing
regenerates the Cargo.lock file. The build then uses the stale lock, and
the copy-back added in 0e65ccc writes it over the committed
Cargo.lock.in.

This can lead to suricata-verify test failures, as updated dependency
versions aren't used, and to the reverted Cargo.lock.in being committed
by mistake.

Make Cargo.lock a prerequisite of all-local so it is regenerated when
Cargo.lock.in is newer, and preserve its timestamp on copy-back, so this
doesn't happen on every build.

Ticket: 9465

@suricata-review-bot suricata-review-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.

AI-generated review.

Verdict: approve

No high- or medium-severity findings.

Automated at commit fa647970a2cf using Claude Code with claude-opus-5-5/xhigh. Run: 8cabdfe7cd42c25c.

@suricata-qa

Copy link
Copy Markdown

Information: QA skipped due to no C or rust code changed detected. Set to force a run.

Pipeline = code

@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.97%. Comparing base (2dd24e7) to head (fa64797).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16754      +/-   ##
==========================================
- Coverage   83.98%   83.97%   -0.02%     
==========================================
  Files        1008     1008              
  Lines      286748   286748              
==========================================
- Hits       240832   240790      -42     
- Misses      45916    45958      +42     
Flag Coverage Δ
fuzzcorpus 61.59% <ø> (-0.01%) ⬇️
livemode 25.92% <ø> (-0.01%) ⬇️
netns 26.29% <ø> (-0.03%) ⬇️
pcap 46.17% <ø> (-0.05%) ⬇️
suricata-verify 69.10% <ø> (-0.03%) ⬇️
unittests 59.23% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants