<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 26, 2018 at 9:20 PM, Eric Fiselier via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>I recently committed <filesystem> to trunk. I wanted to bring attention to some quirks it currently has.</div><div><br></div><div>First, it's been put in a separate library, libc++fs, for now. Users are responsible for linking the library when they use filesystem.<br><br>Second, it should still not be considered ABI stable. Vendors should be aware of this before shipping it. Hopefully all the standard and implementation bugs can be resolved by the next release, and we can move it into the main dylib.</div></div></blockquote><div><br></div><div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">[I have had discussions with several people, and I'm attempting to summarize here]</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Due to factors beyond our control, I do not believe that we can provide a version of std::filesystem and promise future ABI stability at this time.</div><br class="gmail-Apple-interchange-newline">More information:</div><div><br></div><div>* The features for caching directory information were added late in the C++17 cycle, and there have been some concerns about them.</div><div>LWG issue #2708 (<a href="https://wg21.link/lwg2708">https://wg21.link/lwg2708</a>) is one of them, and there are a couple of upcoming papers about the same part of the standard.</div><div><br></div><div>* The clock stuff being added in C++20 has already been discussed here.</div><div><br></div><div><br></div><div>We can:</div><div><br></div><div>1) Not ship std::filesystem, shipping only std::experimental::filesystem.</div><div>I think that this is a disservice to our users; because people are asking for std::filesystem, and other vendors are providing it.</div><div>Note: experimental::filesystem is *different* from std::filesystem, and they're only going to diverge further. In an ideal world, we would have two implementations; one for experimental::filesystem, and the other for std::filesystem, and they would behave differently (each according to their specification)</div><div><br></div><div>2) Ship std::filesystem as it is, as part of libc++.dylib.<br></div><div>I don't think that this is a viable option, given that we are pretty sure (certain) that ABI changes are coming down the pike.</div><div><br></div><div>3) We can ship std::filesystem as a static library; marked as "not ABI stable"</div><div>We can put it into the libc++ dylib once we're confident that we can provide a stable ABI.</div><div><br></div><div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Note: libstdc++ has done exactly this.<div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">SeeĀ <a href="https://www.reddit.com/r/cpp/comments/789g99/gcc_lands_support_for_c_filesystem_ts/">https://www.reddit.com/r/cpp/comments/789g99/gcc_lands_support_for_c_filesystem_ts/</a> for a discussion of this approach.</div><br class="gmail-Apple-interchange-newline"></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">People can use std::filesystem, and include the object code it in their executables, and when the ABI changes, they will be affected at build time, not at run time. The downside is that they will have to re-build to get bug fixes.</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">-- Marshall</div><br></div><div>P.S. I admit that this is not the best of all possible worlds.</div><div><br></div></div></div></div>