Skip to content

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

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

autoantwort
Copy link
Contributor

Fixes microsoft/vcpkg#45070 (comment) where logs from a previous run were copied into the logs folder

#else // ^^^ _WIN32 // !_WIN32 vvv
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
return ts.tv_sec * 1'000'000'000 + ts.tv_nsec;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@@ -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);
Copy link
Member

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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@BillyONeal BillyONeal merged commit 0f26b76 into microsoft:main Apr 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants