Check if the universal library is updated before running lipo#42
Check if the universal library is updated before running lipo#42branchseer wants to merge 3 commits intoTimNN:masterfrom
Conversation
TimNN
left a comment
There was a problem hiding this comment.
Thank you for your contribution! Sorry it took a while for me to get to reviewing it.
I've left some review comments, but in general this looks like a good idea. (I'll also look into getting the CI working again, which would have at least caught the formatting issues).
| use std::path::Path; | ||
|
|
||
| fn is_output_updated(output: impl AsRef<Path>, inputs: impl IntoIterator<Item=impl AsRef<Path>>) -> std::io::Result<bool> { | ||
| let output_mtime = fs::metadata(output)?.modified()?; |
There was a problem hiding this comment.
Can we handle the "file not found" case here explicitly (by returning that the output needs to be updated)? Then we can also log a warning below if this function fails.
There was a problem hiding this comment.
This comment still applies: Can you please explicitly check if fs::metadata returned "not found"?
TimNN
left a comment
There was a problem hiding this comment.
Thank you for applying the changes, and sorry again for taking so long to review, things have been busy 😒.
Can you please rebase the branch on master? I've fixed the CI setup to run on Github actions now.
Optionally: It would be great to have an integration test for this. If you are interested, consider adding one in integration.bats.sh, otherwise let me know and I will add one.
| use std::path::Path; | ||
|
|
||
| fn is_output_updated(output: impl AsRef<Path>, inputs: impl IntoIterator<Item=impl AsRef<Path>>) -> std::io::Result<bool> { | ||
| let output_mtime = fs::metadata(output)?.modified()?; |
There was a problem hiding this comment.
This comment still applies: Can you please explicitly check if fs::metadata returned "not found"?
This PR checks if the universal library is updated by comparing the mtime of it to the inputs.
If I am working on the non-rust part of an Xcode project, everytime I hit the run button
cargo-liporuns. In this case I expect thecargo-lipoto finish quickly since everything in rust is updated, but it takes noticeable time, because of thelipocommand. This PR solves this problem by doing a Makefile-style check before runninglipo.