-
Notifications
You must be signed in to change notification settings - Fork 83
Invalid build results (doesn't invalidate) when headers change (method names, enum order) #315
Comments
Don't worry, I've followed this issue tracker for the last couple of years (and some other people seem to do so, too). :-) |
Seems like clcache is completely drunk when I'm invoking through Visual Studio 2017. I edit the header file, comment out an entire enum used in a .cpp file, and Visual Studio thinks the project's unmodified. I do a full clean and rebuild, and no syntax errors pop up.
INSTALLATION: For Visual Studio, I copied clcache.exe to cl.exe. I added the directory to PATH by copying the entire PATH prepend from "miniconda3 activate". I had to modify clcache's "cl.exe wrapper detector" so cl.exe wrapper wouldn't call itself recursively. Could my setup break high-level caching and header inclusion detection?
|
It sounds like you're using the VS IDE and/or MSBuild to do your builds? Can you please try this again, but just by executing the compiler on the command line directly -- are you still able to reproduce the linker error, i.e. clcache seemingly incorrectly reusing a previously generated object file? |
I have reliably reproduced this in my own project, with CLion build system. Clone https://github.com/jimbo1qaz/0CC-FamiTracker/tree/clion and checkout the
To reproduce the bug:
Minimal test case: attempt 2.zip
First launch build.cmd ( Then change foo.h and foo.cpp to Then undo both foo.h and foo.cpp to |
It would be great if you could reduce this setup such that CLion and CMake wouldn't be part of the setup. Having a minimal test case would allow integrating a unit test into our CI system right away. |
I posted a minimal test case, below the divider Also all Appveyor builds are broken. Should I make a separate issue? |
Ah, sorry - I thought that too contained a CMake system. I'll try to find some time to investigate this evening when I'm out of the office. |
Did you look into the issue yet? I suspect because of the extern object in the header, its class isn't treated as a dependency when rebuilding a .cpp using that object. |
I only looked at it briefly when creating a unit test to reproduce the issue, but I didn't yet investigate why this happens (and I probably won't get around to it this weekend either). If you would like to give it a shot, feel free to! |
We are definitely seeing this too. Invoking clcache via cmake and ninja. |
Am I correct in that this means clcache is pretty much unusable since certain changes in source code may not be picked up? |
I would be very wary when it comes to using clcache, yes. It seems there are some conditions under which it fails to notice that a cache entry cannot be reused. I haven't used clcache myself in about five years, so I cannot say that I noticed the same symptoms. This project is mostly in maintenance-only mode (when I get around tp it), so I hope that -- as was the case in the past -- someone steps up and 'scratches his own itch' by fixing this problem. The most important thing here would be an extension of the test suite such that we can reliably reproduce the problem in the CI builds. |
+1 to link errors. At least two teams on my work affected via this issue. I tested performance on our project for 100% cache hits: ~8 min without server, ~6 with it. But we can't use it :( |
UPD: in our case it could have been caused by using the '--disable_watching' flag. |
Just stumbled upon this issue and freaked out (obviously), so I decided to get @jimbo1qaz's sample a test run. It seems that the bug appears only if The sample can also be simplified down to: //foo.cpp
#include <iostream>
void foo(signed x) {
std::cout << x << std::endl;
}
//foo.h
#pragma once
void foo(signed x);
//main.cpp
#include "foo.h"
int main() {
foo(-1);
} |
I'll fill in details later... but it seems nobody reads this issue tracker anymore
The text was updated successfully, but these errors were encountered: