You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable CARGO_TERM_COLOR automatically in GitLab CI #16969
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.
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.
@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?
Activity
weihanglo commentedon May 6, 2026
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.colorconfig 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.rami3l commentedon Aug 25, 2026
@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?
weihanglo commentedon Aug 25, 2026
Sounds right. Closing
epage commentedon Aug 25, 2026
There is consenus on this? We've already started adding CI detection to cargo.
weihanglo commentedon Aug 25, 2026
No problem to keep this open for more discussions. Reopening.