Skip to content

Detect CI-platforms and incremental compilation #11853

@lukaslueg

Description

@lukaslueg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions