-
Notifications
You must be signed in to change notification settings - Fork 37.7k
ci: A few fixes of ccache
issues
#27084
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
.cirrus.yml
Outdated
@@ -5,8 +5,9 @@ env: # Global defaults | |||
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache | |||
CI_FAILFAST_TEST_LEAVE_DANGLING: "1" # Cirrus CI does not care about dangling process and setting this variable avoids killing the CI script itself on error | |||
CCACHE_SIZE: "200M" | |||
CCACHE_DIR: "/tmp/ccache_dir" | |||
CCACHE_DIR: '${CIRRUS_WORKING_DIR}/ccache_dir' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will still be in the same volume (tmp), so why is this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the difference for Cirrus CI is not using absolute path /tmp/...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still not sure what this means and which paths are preferred or discouraged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description has been updated with some statistics. |
Most of the changes here look straight forward enough, and clearly improve |
Making this PR a draft for now. |
This change avoids any possible cache binary incompatibility.
By default, `ccache` includes the modification time (`mtime`) and size of the compiler in the hash to ensure that results retrieved from the cache are accurate. But in CI environment compiler's `mtime` can be unique each run.
This change improves cache hit rates for the touched CI tasks.
The questionable commit has been dropped. Ready to re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -36,6 +36,8 @@ main_template: &MAIN_TEMPLATE | |||
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out | |||
ccache_cache: | |||
folder: "/tmp/ccache_dir" | |||
fingerprint_script: echo ${CIRRUS_TASK_NAME} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already the default?
By default the task name is used as a fingerprint value.
https://cirrus-ci.org/guide/writing-tasks/#cache-instruction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already the default?
Yep looks like it.
@@ -36,6 +36,8 @@ main_template: &MAIN_TEMPLATE | |||
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out | |||
ccache_cache: | |||
folder: "/tmp/ccache_dir" | |||
fingerprint_script: echo ${CIRRUS_TASK_NAME} | |||
reupload_on_changes: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already the default?
true otherwise
https://cirrus-ci.org/guide/writing-tasks/#cache-instruction
Well, speaking of the removed questionable commit, I've finally managed to provide steps to reproduce unexpected behavior without that commit:
Besides the description above, I have no decent explanation of what is really happening. But s/ |
It would be good to double check if this is recommended "officially" by Cirrus CI. In any case |
I guess instead of |
While it works for the |
lgtm. While it would be good to be able to point to docs, I don't think this is required. Happy to review if you move this out of draft. |
🐙 This pull request conflicts with the target branch and needs rebase. |
What is the status of this |
Combined #27077 and #27083 for the sake of more representative testing.
The second run looks promising:
Although, the "previous releases" task has a 66.10 % cache hit rate. It needs more investigation (not in this PR).