What is modifying Cargo.lock in the background and why?

I've got an older project that I'm returning to and I've encountered something strange and rather unsettling: Git keeps reporting that my repo is dirty.

I run git stash and huh... it's still dirty.

I run this "little" one-liner in a different from my usual shell (in a perhaps imperfect effort to avoid any "bonus" features in my prompt) get some interesting results:

sh-3.2$ echo DIFF1 && git diff && git checkout Cargo.lock && echo DIFF2 && git diff && sleep 3 && echo DIFF3 && git diff
DIFF1
diff --git a/Cargo.lock b/Cargo.lock
index 085c590..69c4d30 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,3 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
 [[package]]
 name = "adler32"
 version = "1.0.2"
DIFF2
DIFF3
diff --git a/Cargo.lock b/Cargo.lock
index 085c590..69c4d30 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,3 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
 [[package]]
 name = "adler32"
 version = "1.0.2"

Something seems to be modifying Cargo.lock without any action on my part. And looking though my system's running processes, there's nothing obviously related to cargo or rust.

The change itself seems reasonable, based on the relevant issue, but why the fuck is it happening constantly via a seemingly obfuscated actor rather than just when I manually run a cargo command?

Pardon my language, but this just seems extremely sketchy.

It's probably your IDE running checks, using rls, rust-analyzer, or IntelliJ Rust.

1 Like

Ah ha, yes it does stop when I exit Vim and start again when I reopen one of the rust source files in the repo. That makes sense and no longer seems so sketchy.

Thanks!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.