Skip to content

Commit

Permalink
Apply GHC options when building Setup.hs (fixes #4526)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Mar 25, 2019
1 parent 8369ea3 commit 8da7f04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ Bug fixes:
See [#4453](https://github.com/commercialhaskell/stack/issues/4453).
* Extra include and lib dirs are now order-dependent. See
[#4527](https://github.com/commercialhaskell/stack/issues/4527).
* Apply GHC options when building a `Setup.hs` file. See
[#4526](https://github.com/commercialhaskell/stack/issues/4526).

## v1.9.3

Expand Down
12 changes: 11 additions & 1 deletion src/Stack/Build/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,17 @@ withSingleContext ActionContext {..} ExecuteEnv {..} task@Task {..} mdeps msuffi
] ++
(case compiler of
Ghc -> []
Ghcjs -> ["-build-runner"])
Ghcjs -> ["-build-runner"]) ++

-- Apply GHC options
-- https://github.com/commercialhaskell/stack/issues/4526
map T.unpack (
Map.findWithDefault [] AGOEverything (configGhcOptionsByCat config) ++
case configApplyGhcOptions config of
AGOEverything -> boptsCLIGhcOptions eeBuildOptsCLI
AGOTargets -> []
AGOLocals -> [])

liftIO $ atomicModifyIORef' eeCustomBuilt $
\oldCustomBuilt -> (Set.insert (packageName package) oldCustomBuilt, ())
return outputFile
Expand Down

0 comments on commit 8da7f04

Please sign in to comment.