Skip to content

BuildLogsRecorder: Only copy new log files#1657

Merged
BillyONeal merged 2 commits intomicrosoft:mainfrom
autoantwort:feature/only-new-logs-2
Apr 25, 2025
Merged

BuildLogsRecorder: Only copy new log files#1657
BillyONeal merged 2 commits intomicrosoft:mainfrom
autoantwort:feature/only-new-logs-2

Conversation

@autoantwort
Copy link
Copy Markdown
Contributor

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

Comment thread 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;
Copy link
Copy Markdown
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

Comment thread include/vcpkg/commands.build.h Outdated
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
Copy Markdown
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.

Comment thread src/vcpkg/base/files.cpp
#endif // ^^^ !_WIN32
}

int64_t file_time_now() const override
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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