Skip to content

Commit

Permalink
Don't do createDirectoryLink on Windows noci
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Nov 19, 2023
1 parent ef3f772 commit ff3e0da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sandwich/src/Test/Sandwich/Interpreters/StartTree.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}

module Test.Sandwich.Interpreters.StartTree (
startTree
Expand Down Expand Up @@ -204,7 +205,12 @@ runInAsync node ctx action = do
exists <- doesPathExist symlinkPath
when exists $ removePathForcibly symlinkPath

#ifndef mingw32_HOST_OS
-- Don't do createDirectoryLink on Windows, as creating symlinks is generally not allowed for users.
-- See https://security.stackexchange.com/questions/10194/why-do-you-have-to-be-an-admin-to-create-a-symlink-in-windows
-- TODO: could we detect if this permission is available?
liftIO $ createDirectoryLink relativePath symlinkPath
#endif

-- Write failure info
whenJust baseContextPath $ \dir -> do
Expand Down

0 comments on commit ff3e0da

Please sign in to comment.