Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore CARGO_TERM_COLOR as an env var cache key. #87

Open
vorporeal opened this issue Oct 28, 2022 · 3 comments
Open

Ignore CARGO_TERM_COLOR as an env var cache key. #87

vorporeal opened this issue Oct 28, 2022 · 3 comments

Comments

@vorporeal
Copy link

This variable, while starting with CARGO_, doesn't have any impact on compilation output, just what cargo prints to stdout/stderr, and as such, shouldn't factor into the cache key at all.

@Swatinem
Copy link
Owner

You are right. On the other hand, if you just set it once, and never change it, it does not matter at all either 🤷🏻‍♂️

@vorporeal
Copy link
Author

vorporeal commented Oct 31, 2022

True!

The issue I encountered was that I added that environment variable to our CI workflow but not a separate workflow that runs against our main branch to populate the cache (so that the cache is shared across feature branches) and it, unexpectedly, led to our main branch cache having a cache key that didn't get matched by feature branch caches.

The context is that I migrated our CI to use nextest, which recommends setting CARGO_TERM_COLOR: always in your CI jobs for more readable output. Despite being the individual on our team with the most context around our use of the rust-cache action, I did not expect this environment variable to have any effect on cache keys.

Our caching was "broken" for a couple weeks before I got lucky and noticed the issue.

While it won't affect me again in the future, it could certainly catch other users by surprise.

@lebensterben
Copy link

I second this request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants