summaryrefslogtreecommitdiff
path: root/compiler/main/SysTools.hs
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2018-08-11 19:25:09 +0100
committerTamar Christina <tamar@zhox.com>2018-08-25 11:24:37 +0100
commitc523525b0e434d848f6e47ea3f9a37485965fa79 (patch)
tree1b3dd6ec250366dfd21293b23cd012d7af3f41fb /compiler/main/SysTools.hs
parentff29fc84c03c800cfa04c2a00eb8edf6fa5f4183 (diff)
downloadhaskell-c523525b0e434d848f6e47ea3f9a37485965fa79.tar.gz
ghc, ghc-pkg: use getExecutablePath on Windows when base >= 4.11.0
Summary: This completes the work started in D4227 by using just 'getExecutablePath' in ghc and ghc-pkg when building with base >= 4.11.0. On the long term, we will be able to simply kill the existing code that follows (or not) symlinks and just get this behaviour for free from getExecutable. For now we however have to require base >= 4.11.0 to be able to just use getExecutablePath under Windows, and use the current code when building with an older base. Original code by @alpmestan commandeering since patch has been stale and bug remains open. Test Plan: Validate Reviewers: angerman, bgamari, erikd, alpmestan Reviewed By: bgamari Subscribers: carter, rwbarton, thomie GHC Trac Issues: #14483 Differential Revision: https://phabricator.haskell.org/D4229
Diffstat (limited to 'compiler/main/SysTools.hs')
-rw-r--r--compiler/main/SysTools.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs
index ff36c04ecf..9bbce19602 100644
--- a/compiler/main/SysTools.hs
+++ b/compiler/main/SysTools.hs
@@ -141,12 +141,12 @@ initSysTools top_dir
mtool_dir <- findToolDir top_dir
-- see Note [tooldir: How GHC finds mingw and perl on Windows]
- let settingsFile = top_dir </> "settings"
- platformConstantsFile = top_dir </> "platformConstants"
- installed :: FilePath -> FilePath
+ let installed :: FilePath -> FilePath
installed file = top_dir </> file
libexec :: FilePath -> FilePath
libexec file = top_dir </> "bin" </> file
+ settingsFile = installed "settings"
+ platformConstantsFile = installed "platformConstants"
settingsStr <- readFile settingsFile
platformConstantsStr <- readFile platformConstantsFile