This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Avoid including things that require a filesystem in filesytem_clock.cpp
ClosedPublic

Authored by ldionne on Jul 3 2023, 1:57 PM.

Details

Summary

The filesystem clock implementation should be available regardless of
whether a proper filesystem is available on the platform, so it makes
sense to try and avoid including things that are inherently filesystem-y
in the implementation of filesystem clock.

Diff Detail

Event Timeline

ldionne created this revision.Jul 3 2023, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 3 2023, 1:57 PM
Herald added a subscriber: mstorsjo. · View Herald Transcript
ldionne requested review of this revision.Jul 3 2023, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 3 2023, 1:57 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne updated this revision to Diff 537109.Jul 4 2023, 8:06 AM

Fix Windows issue.

With these changes, copied from chrono.cpp, this patch fixes building with picolibc.

libcxx/src/filesystem/filesystem_clock.cpp
22–24
39

With these changes, copied from chrono.cpp, this patch fixes building with picolibc.

Ok, thanks a lot. But just to be sure, this wasn't working previously with picolibc, was it? Or did it start failing only when I split up the source files?

I'll ship this as-is because it passes the CI and it makes sense as a self-standing change. I'll apply your suggested changes in another patch, I'll ping you.

ldionne accepted this revision.Jul 4 2023, 11:28 AM
This revision is now accepted and ready to land.Jul 4 2023, 11:28 AM

Ok, thanks a lot. But just to be sure, this wasn't working previously with picolibc, was it? Or did it start failing only when I split up the source files?

The picolibc build was working previously and started failing after D152382 landed. D154457 fixes it, thanks!