CC environment variable changing, causing re-compilation in rust

Hey nix-friends.

I’m having an issue where some rust modules will continually rebuild because they are detecting a change in the CC environment variable.

My setup is that I’m running NixOS with home-manager and devshell. I’ve tried with gcc set at the devshell, home-manager and nix-os levels.

If I cargo build my repository, it will rebuild blake3 (some random module I need). If I immediately do it again, it doesn’t rebuilt. If I edit any file in my workspace, blake3 will rebuild.

Is there any sort of statefulness around environment variables tied to working directory state that folks are aware of? Any other ideas on what could be going wrong.

Relevant links: