Open justinabrahms opened 11 months ago
I'm also having this issue.
build.rs
contains these lines, which might be related:
// The `cc` crate doesn't automatically emit rerun-if directives for the
// environment variables it supports, in particular for $CC. We expect to
// do a lot of benchmarking across different compilers, so we explicitly
// add the variables that we're likely to need.
println!("cargo:rerun-if-env-changed=CC");
println!("cargo:rerun-if-env-changed=CFLAGS");
I'd be curious if removing those lines fixes the issue for you. That wouldn't tell us the whole story, but it would be a big part. Also, can you reproduce this issue in any open source project that I could also build for myself. It would help to see it happen on my own machine.
Yeah, it's almost certainly to do with those rerun directives.
I was messing around with it earlier and I did notice that it only ever happens in my VS Code terminal, which is quite weird. There are a lot of moving parts w.r.t. the terminal in my particular project because I'm using a Nix shell w/ Direnv, so it's going to be a bit difficult to track down the issue, but I'll set aside some time tomorrow to work on a minimal reproduction.
I have similar problem on Voidlinux. But with small difference: dirty: EnvVarChanged { name: "CC", old_value: Some("gcc"), new_value: None }
. I found a workaround for this. In my case worked exporting CC and AR manually:
I have the same problem on Windows when using Bevy game engine. Any change triggers blake3 recompilation - is this expected?
Edit: it seems like clippy may be triggering that. It happens on code change when I use RustRover, because I configured it to run clippy in the background. I'm still not sure if this is expected or not.
Folks who can repro this, can you help me clarify: Are the values of these env vars actually changing every time? If so what sort of values are they taking? (If not, could this be a cc
bug?)
Just a note that I no longer work for this company and don't have access to that laptop or code base. Hopefully Max will be of more help to you.
Blake3 is in my transitive dependency chain. When I edit my code, it recompiles every time. It seems to believe that the environment variable is changing.. but I'm just editing a file, nothing more.
Most seemingly relevant line below.
Thoughts?