-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Problem
It seems to be consensus that using incremental compilation on CI platforms outweighs the benefits: A blank build starts from a blank cache, and the bookkeeping for incremental compilation is a cost we pay that never gets amortized, as the next build starts from a blank cache again or trashes the cache. People using GH-actions infrastructure like dtolnay/rust-toolchain already have incremental compilation disabled for them automatically due to this (see also).
Proposed Solution
It seems easy enough for Cargo to detect CI platforms, issue a warning if incremental compilation is enabled, and suggest to set CARGO_INCREMENTAL=0.
Notes
We should make sure that CI-platforms are detected reliably before issuing a warning. For example, a single CI-environment-variable will suffer from false positives and useless warnings.
Also, the warning issued by cargo might not reach the user, if the logs on a successful build are never reviewed. Yet, there is no cost to this problem.