Add cipd_version to compile_3p_crates invocation

Change-Id: I8627b13491c44a4b7bcf8e76093f29bb06c36bde
diff --git a/rustc_deps/BUILD.gn b/rustc_deps/BUILD.gn
index 324bf74..ff3630f 100644
--- a/rustc_deps/BUILD.gn
+++ b/rustc_deps/BUILD.gn
@@ -26,6 +26,14 @@
 action("build-third-party") {
   script = "//build/rust/compile_3p_crates.py"
 
+  # We want to force a recompile of the Rust world whenever Rust toolchain
+  # changes since artifacts from an older version of the toolchain may or
+  # may not be compatible with newer ones.
+  # To achieve this, we insert a synthetic argument to the script invocation.
+  cipd_version = read_file(
+          "//buildtools/${host_platform}/rust/.versions/rust.cipd_version",
+          "json")
+
   inputs = [ third_party_lock, third_party_toml ]
   deps = [ "//garnet/public/sdk:zircon_sysroot_export" ]
 
@@ -58,6 +66,7 @@
   out_deps_data = "${out_dir}/deps_data.json"
   args = [
     "--rustc", rebase_path("${rustc_prefix}/rustc"),
+    "--cipd-version", cipd_version.instance_id,
     "--cargo", rebase_path("${rustc_prefix}/cargo"),
     "--crate-root", rebase_path("//third_party/rust-crates/rustc_deps"),
     "--opt-level", opt_level,