[libcxx-commits] [PATCH] D89530: [libcxx] [test] Fix filesystem_test_helper.h to compile for windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 16 06:07:44 PDT 2020


mstorsjo added inline comments.


================
Comment at: libcxx/test/support/filesystem_test_helper.h:253
     static_test_env() {
+#ifndef _WIN32
         env_.create_symlink("dne", "bad_symlink", false);
----------------
ldionne wrote:
> What are we missing to handle those correctly? I would rather not `#ifdef` them out if it's just "until we've fixed it". Or, at least, please put up another patch that removes them and mark it as a child of this one.
As mentioned in the post on libcxx-dev (which I admittedly didn't refer to in this review), symlinks on windows are pretty icky.

You either need to run your process with "elevated privileges", or be running your machine on windows 10 with developer mode enabled and do the syscall for creating the symlink with the flag `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE` set. Not sure if that developer mode flag is set on e.g. buildbots and similar. But I guess we could and should try to use that - MS STL uses that at least.

And symbolic links in general on windows has a bit different semantics than on posix, iirc.

So far I've postponed looking into the whole symlinks bit (and ifdeffed out anything touching symlinks in the rest of the tests), but I guess I could at least try to create them here, to get this patch into a more acceptable form.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89530/new/

https://reviews.llvm.org/D89530



More information about the libcxx-commits mailing list