-
Notifications
You must be signed in to change notification settings - Fork 317
BuildLogsRecorder: Only copy new log files #1657
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
BuildLogsRecorder: Only copy new log files #1657
Conversation
src/vcpkg/base/files.cpp
Outdated
#else // ^^^ _WIN32 // !_WIN32 vvv | ||
struct timespec ts; | ||
clock_gettime(CLOCK_REALTIME, &ts); | ||
return ts.tv_sec * 1'000'000'000 + ts.tv_nsec; |
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.
return ts.tv_sec * 1'000'000'000 + ts.tv_nsec; | |
return int64_t{ts.tv_sec} * 1'000'000'000 + ts.tv_nsec; |
Otherwise it's not necessarily safe to do that
include/vcpkg/commands.build.h
Outdated
@@ -42,7 +42,7 @@ namespace vcpkg | |||
|
|||
struct CiBuildLogsRecorder final : IBuildLogsRecorder | |||
{ | |||
explicit CiBuildLogsRecorder(const Path& base_path_); | |||
explicit CiBuildLogsRecorder(const Path& base_path_, int64_t minimum_last_write_time = 0); |
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.
Does this need the = 0? It seems like all callers should be required to pass it.
@@ -3812,6 +3824,39 @@ namespace vcpkg | |||
#endif // ^^^ !_WIN32 | |||
} | |||
|
|||
int64_t file_time_now() const override |
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.
Hmmm this doesn't seem to actually touch the filesystem and thus it could just be a nonmember?
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.
Could be. But if you want to implement a fake filesystem you maybe want to change its implementation.
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.
Thanks!
Fixes microsoft/vcpkg#45070 (comment) where logs from a previous run were copied into the logs folder