On 22 Dec 2025 19:29, Peter Dimov via Boost wrote:
Gennaro Prota wrote:
Hi,
I'm getting some errors from Filesystem in the Cygwin tests of DynamicBitset. I see that Filesystem is tested on Cygwin, so this is odd. Could a maintainer please have a look? Thanks.
<https://github.com/boostorg/dynamic_bitset/actions/runs/20430426737/job/58699726648>.
Probably caused by my merging https://github.com/boostorg/system/pull/137.
Historically, Boost.Filesystem has been using Boost.System's BOOST_POSIX_API and BOOST_WINDOWS_API macros for deciding between POSIX and Windows APIs. Unfortunately, this is not limited just to the underlying implementation of filesystem operations but is also reflected in the native character type used in filesystem::path. The change switched from Windows (wchar_t) to POSIX (char) style API, which is potentially a user-breaking change. Where users previously provided and received wide strings for paths, which were treated as native, now character code conversion will happen, which may or may not work well, depending on the installed locale. The fact that Cygwin is treated as Windows is also mentioned in the documentation. Restoring the previous behavior (by introducing and using Boost.Filesystem-specific set of macros) is easy enough, and I will fix this shortly. But here is the question: do we actually want to consistently treat Cygwin as a POSIX platform across Boost libraries? In regards to Boost.Filesystem, I'm not sure what Cygwin runtime does with paths, as it eventually has to interact with the underlying Windows API. Does it perform character code conversion? Is that conversion correct? Which encoding does it expect? My default opinion wrt. filesystem paths is that one should mess with them as little as possible. Character code conversion is generally a bad idea, unless it is unavoidable. In this regard, continuing to use Windows API on Cygwin is preferable. However, I can understand that it may be surprising to some users who expect native POSIX-style behavior on Cygwin, with any Cygwin-specific features. E.g., I think, Cygwin has its own implementation of symlinks that are incompatible with Windows. So I'm asking the community, what do you think should Boost.Filesystem do? Should it follow other Boost libraries and treat Cygwin as a POSIX system?