From 0392e5c93339e6d7f32bb5505f45ae195e543438 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 9 Feb 2024 00:21:47 +0200 Subject: [PATCH] Work around unnecessary recompilations of aws-sdk crates See comment for details. --- .cargo/config.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 5e452974ad..5d002e35f6 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,3 +6,25 @@ rustdocflags = ["-Arustdoc::private_intra_doc_links"] [alias] build_testing = ["build", "--features", "testing"] neon = ["run", "--bin", "neon_local"] + +[env] + +# Set AWS_SDK_RUST_BUILD_UA_METADATA to avoid a cargo issue that +# caused recompiling aws-sdk crates every time. +# +# Without this, running "cargo build" would recompile the aws-sdk +# crates every time, even if nothing changed. Cargo fingerprint +# debugging showed this: +# +# $ CARGO_LOG=cargo::core::compiler::fingerprint=info cargo build --features testing --bins +# 0.422450751s INFO cargo::core::compiler::fingerprint: stale: changed env "AWS_SDK_RUST_BUILD_UA_METADATA" +# 0.422465658s INFO cargo::core::compiler::fingerprint: Some("") != None +# ... +# +# That seems bogus. Seems that something in cargo or the build scripts +# is being confused about the variable being set to empty string, or +# not set at all. +# +# To work around that, set the env variable explicitly. That way, +# cargo recognizes it as "not changed" +AWS_SDK_RUST_BUILD_UA_METADATA=""