-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't rerun if PATH changes #1215
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(duplicate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should do something more?
I.e. when executing binaries, get the path of binary and ask cargo to watch it.
Unfortunately there isn't any API in stdlib to do so and it sounds a hit too hard for now, but I think we should think about this.
Yeah, that might be nice but would definitely be a more complex feature as we'd need to account for different platforms. |
And it'd still be half broken: If user add another compiler in /usr/local/bin/cc while we ask cargo to detect change at /usr/bin/cc, it'd still miss that. I think if we want to do this correctly, by making sure we always recompiles if the compiler gets swapped, we will have to do it the same way sccache detects change. We will have to open the compiler binary, hashed the binary itself, and all the dynamic libraries it linked in (libclang.so, libllvm.so). We'd need a new |
And even that may not work, if the compiler is wrapped by a bash script. Honestly I feel like this is something incredibly hard to get right, we probably want to document this in our crate-level doc. |
That's probably a better approach. Honestly, users know their build better than we can possibly infer and are therefore better able to do this. Or at least there's no way we can reasonably cover all cases well. |
Prevents spurious rebuilds on Windows (https://github.com/rust-lang/cc-rs/pull/1103/files#r1674907945) as suggested by @NobodyXu.
Originally posted by oconnor663
Originally posted by NobodyXu