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
Don't hash shared libraries for cache key #10841
Conversation
0a4ad57
to
5120a4b
Compare
I'm not sure the failed tests are related 🤔 |
ab49bc5
to
97fa45f
Compare
lib/rubocop/result_cache.rb
Outdated
if path.end_with?(*DL_EXTENSIONS) | ||
# shared libraries often contain timestamps of when | ||
# they were compiled and other non-stable data | ||
path |
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.
Hum, actually when we hash the .rb
files, we don't care where they are located. So using the path as a "digest" mean that the BUNDLE_PATH
now has influence, that may also be a problem for some cases. Maybe we should just extract a small name, e.g. Zlib.crc32(File.basename(path)).to_s
.
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.
Yeah good point.
c851d23
to
30eb8cd
Compare
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.
Looks good to me, regarding the changed functionality. I had some minor comments.
30eb8cd
to
f7f9bd9
Compare
♻️ @jonas054 please have another look |
Hmm, lots of tests are currently failing. |
Looks like there are some RuboCop offense in lib/rubocop/result_cache.rb
|
f7f9bd9
to
1f79ac9
Compare
Fixed my Rubocop violation and rebased on latest master but seems there are still some broken in |
Shared libraries often contain timestamps of when they were compiled and other non-stable data hence would often produce different hashes on different machines
1f79ac9
to
1839d17
Compare
Thanks! |
Shared libraries often contain timestamps of when they were compiled and other non-stable data
hence would often produce different hashes on different machines. This happens often in our CI.
Related to #8633
cc @casperisfine
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.