spotify / XCRemoteCache

Other
833 stars 52 forks source link

Assumes compiler is deterministic #16

Open ohmantics opened 2 years ago

ohmantics commented 2 years ago

This assumes the compiler is deterministic. It is not proven so.

polac24 commented 2 years ago

I assume you talk about incremental determinism. And yes, if a compiler has a bug and incorrectly specifies a list of dependency files in .d file, XCRemoteCache can overcache. The same problem would surface for a non-cacheable build in Xcode but there is always a fallback: clean DerivedData and build from scratch again. To be prepared for such edge-cases, we introduced --targets-exclude parameter which, as name suggests, forces the local build for that target. Fortunately, we haven't got that problem yet so maybe it is not that common.

Regarding other determinism, we know that basic will not be met and all class of literals like Swift's#filepath may have rubbish value. As we don't compare byte level dependencies (e.g. swiftmodule has its own "fingerprint" that is carried over), we will not have false positives/negatives but just incorrect data - which developers could expect if they use such a risky macro/literal.