Skip to content
  • Tamar Christina's avatar
    Resolve symlinks when attempting to find GHC's lib folder on Windows · a3922083
    Tamar Christina authored
    Summary:
    Systools makes some pretty hard assumptions about where GHC is on Windows.
    One of these is that ghc be in a folder named `bin` and that `../lib` exists.
    
    This pattern doesn't hold for symlinks as a link `C:\ghc-bin\`
    pointing to `C:\ghc\ghc-7.10.3\bin` will break this assumption.
    
    This patch resolves symlinks by finding where they point to and uses that location
    as the base for GHC.
    
    This uses an API that's been introduced in Vista. For older systems it falls back to
    the current behavior of not resolving symlinks.
    
    Test Plan:
    1) Create symlink to GHC's bin folder.
    2) Run GHC from that folder.
    
    Reviewers: austin, bgamari
    
    Reviewed By: austin
    
    Subscribers: #ghc_windows_task_force, thomie
    
    Differential Revision: https://phabricator.haskell.org/D2101
    
    GHC Trac Issues: #11759
    a3922083