Skip to content

Commit b27e95b

Browse files
committed
Merge branch 'hasufell-fix-stack-setup-gcc'
2 parents 3ecd5b6 + 6fe5a3c commit b27e95b

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

ChangeLog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ Bug fixes:
4949
set [#53](https://github.com/commercialhaskell/pantry/pull/53)
5050
* Pass any CPP options specified via `cpp-options:` in the `.cabal` file to GHCi
5151
using GHC's `-optP` flag. See
52-
[#5608](https://github.com/commercialhaskell/stack/pull/5608)
52+
[#5608](https://github.com/commercialhaskell/stack/pull/5608)
53+
* On Unix-like operating systems, respect the `with-gcc` option when installing
54+
GHC. See [#5609](https://github.com/commercialhaskell/stack/pull/5609)
5355

5456
## v2.7.5
5557

src/Stack/Setup.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,9 +1460,21 @@ installGHCPosix downloadInfo _ archiveFile archiveType tempDir destDir = do
14601460

14611461
dir <- expectSingleUnpackedDir archiveFile tempDir
14621462

1463+
mOverrideGccPath <- view $ configL.to configOverrideGccPath
1464+
1465+
-- The make application uses the CC environment variable to configure the
1466+
-- program for compiling C programs
1467+
let mGccEnv = let gccEnvFromPath p =
1468+
Map.singleton "CC" $ T.pack (toFilePath p)
1469+
in gccEnvFromPath <$> mOverrideGccPath
1470+
1471+
-- Data.Map.union provides a left-biased union, so mGccEnv will prevail
1472+
let ghcConfigureEnv =
1473+
fromMaybe Map.empty mGccEnv `Map.union` gdiConfigureEnv downloadInfo
1474+
14631475
logSticky "Configuring GHC ..."
14641476
runStep "configuring" dir
1465-
(gdiConfigureEnv downloadInfo)
1477+
ghcConfigureEnv
14661478
(toFilePath $ dir </> relFileConfigure)
14671479
(("--prefix=" ++ toFilePath destDir) : map T.unpack (gdiConfigureOpts downloadInfo))
14681480

stack.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ extra-source-files:
5454
doc/README.md
5555
doc/shell_autocompletion.md
5656
doc/SIGNING_KEY.md
57+
doc/Stack_and_VS_Code.md
5758
doc/stack_yaml_vs_cabal_package_file.md
5859
doc/travis_ci.md
5960
doc/yaml_configuration.md

0 commit comments

Comments
 (0)