-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
only hash Cargo.toml/Cargo.lock that belong to a configured workspace #90
Conversation
Closes #89 |
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 have two comments:
I believe rust-toolchain
is workspace specific, though I’m not entirely sure.
You are overwriting keyFiles
in the globHash
function, though it is later being printed, so you would lose half the output in the cache summary if you specify multiple workspaces. Also, the hash now depends on the order of how you define the workspaces
.
I believe a better way would be first glob/collect all the files into keyFiles
, sort them once and then create a hash from that one.
src/config.ts
Outdated
} | ||
} | ||
|
||
await globHash("rust-toolchain\nrust-toolchain.toml"); |
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’m wondering, is the rust-toolchain
file something workspace specific? I think so?
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.
You're right, cargo uses the closest one but it'll search all the way to the root.
This improves the lock hash to not include Cargo files that are not relevant to the cache by only checking the defined workspace folders.