Skip to content

Enable CARGO_TERM_COLOR automatically in GitLab CI #16969

Open

Description

@TheJanzap

Problem

I would like to have automatic colored output from Cargo in GitLab CI. Currently, I have to manually set CARGO_TERM_COLOR: always in my CI config to enable it. This would be a nice convenience feature to have.

Proposed Solution

Detect if Cargo is running in GitLab CI/CD and enable colored output.

Notes

No response

Activity

  1. added
    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.
    on May 6, 2026
  2. weihanglo commented on May 6, 2026

    @weihanglo
    Member

    While color in the GitLab UI can be nicer (as well as in GitHub Actions UI), enabling it by default also changes the raw log output as ANSI escape sequences will always appear in it. It is not everyone wants and could be considered as a breaking change.

    Since Cargo already supports explicit opt-in via term.color config and equivalent environment variable, the feature request feels hard to me to justify. Also, if we really want this, we should have a broader CI-color policy rather than a vendor-specific behavior.

  3. rami3l commented on Aug 25, 2026

    @rami3l
    Member

    @weihanglo Given the current consensus that rustup should provide relevant basic CI setup for the whole Rust installation, maybe we can close this in favor of rust-lang/rustup#5011?

  4. weihanglo commented on Aug 25, 2026

    @weihanglo
    Member

    Sounds right. Closing

  5. epage commented on Aug 25, 2026

    @epage
    Contributor

    There is consenus on this? We've already started adding CI detection to cargo.

  6. weihanglo commented on Aug 25, 2026

    @weihanglo
    Member

    No problem to keep this open for more discussions. Reopening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-console-outputArea: Terminal output, colors, progress bar, etc.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