On Wed, 4 Mar 2026 at 23:17, Adam Wood <[email protected]> wrote: > > > > On Wed, Mar 4, 2026 at 9:14 AM Jonathan Wakely <[email protected]> wrote: >> >> On Mon, 16 Feb 2026 at 22:42, Adam Wood <[email protected]> wrote: >> > >> > Tested on x86_64-w64-mingw32 on Windows 11. >> > >> > The changes in v4 make sure the new symlink functions are only >> > defined/enabled >> > on versions of Windows with symlink support. >> > >> > Because path resolution may be different between Windows and POSIX when a >> > dotdot follows a symlink, I also made some edits to tests involving that >> > specific case. I removed my changes to fs::absolute and >> > fs::canonical because I was misplaced and was trying to force Windows to >> > act like POSIX in that specific case. >> > >> > Finally, I dealt with the issue that creating symlinks with the >> > unprivileged >> > flag returns an error in earlier versions of Windows by just trying again >> > if ERROR_INVALID_PARAMETER occurs without the unpriviledged flag. This >> > is how MSVC STL does it as well. >> > >> > The patch does not support junctions or mount points. >> >> Hi Adam, >> >> Thanks for the new patch. I'm still reviewing it, but I see these >> tests failing using a mingw-w64 cross compiler and testing under Wine: >> >> /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/copy_symlink/1.cc:27: >> void test_successful_copy(const std::filesystem::__cxx11::path&, bool >> (*)(const std::filesystem::__cxx11::path&)): Assertion >> 'is_some_file_type(p2)' failed. >> FAIL: >> /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/copy_symlink/1.cc >> >> >> /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/symlink_status.cc:36: >> void test01(): Assertion 'st1.type() == fs::file_type::directory' >> failed. >> FAIL: >> /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/symlink_status.cc >> >> Do these PASS for you on real Windows? >> > Those tests all PASS on my Windows 11 VM.
I've installed a Windows 11 VM. I built all the filesystem tests using a mingw-w64 cross compiler and ran the tests under Wine. For each test that PASSed before your changes and FAILed with your patch, I copied the .exe to the Windows VM and ran it there, and they also FAILed on the VM. So this doesn't seem to be a problem with Wine, the tests FAIL for Windows 11 too. At least the following fail, and several seem to be related to failing filesystem::is_directory checks. /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/directory_entry/86597.cc:40: void test01(): Assertion 'ent.is_directory(ec)' failed. FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/directory_entry/86597.cc terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error' what(): filesystem error: cannot remove: Access denied [filesystem-test.caching.3601102154.416] FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/iterators/caching.cc /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/iterators/pop.cc:60: void test02(): Assertion 'dir != end(dir)' failed. FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/iterators/pop.cc terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error' what(): filesystem error: cannot remove: Access denied [filesystem-test.recursion_pending.3954863444.480] FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursion_pending.cc /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:51: void test01(): Assertion '!ec' failed. FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/weakly_canonical.cc:50: void test01(): Assertion 'p == dirc/"bar/baz"' failed. FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/weakly_canonical.cc Skipping tests that depend on filesystem permissions /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/remove.cc:92: void test01(): Assertion '!ec' failed. FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/remove.cc /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/remove_all.cc:67: void test01(): Assertion '!ec' failed. FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/remove_all.cc /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/status.cc:35: void test01(): Assertion 'st1.type() == fs::file_type::directory' failed. FAIL: /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/27_io/filesystem/operations/status.cc
