Skip to content

Commit

Permalink
Fix issue #2289, apply ghc-options to snapshot pkg
Browse files Browse the repository at this point in the history
Commit c891a24 created a regression, ghc-options were no longer applied to
packages in the snapshot. The "mini build plan" for missing snapshot packages
did not check the configuration's "ghc-options" settings at all, so even
configurations with "apply-ghc-options: everything" would not apply those
options.

This commit, combined with a change to config.yaml, fixes these issues:

DanielG/ghc-mod#762
IHaskell/IHaskell#636

To fix those issues,  (usually located in ) should
contain:

And for snapshots already installed, the following command will force stack
to rebuild them with those options:

*Not tested:* Alternatively, add the line  to
. This may cause undesirable behavior in forcing all ghc-options
changes to rebuild the snapshot.
  • Loading branch information
AaronFriel committed Jun 25, 2016
1 parent ee2457a commit 675f834
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Stack/Build/Source.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ loadSourceMap needTargets boptsCli = do
let p = lpPackage lp
in (packageName p, PSLocal lp)
, extraDeps3
, flip fmap (mbpPackages mbp) $ \mpi ->
PSUpstream (mpiVersion mpi) Snap (mpiFlags mpi) (mpiGhcOptions mpi) (mpiGitSHA1 mpi)
, flip Map.mapWithKey (mbpPackages mbp) $ \n mpi ->
let configOpts = getGhcOptions bconfig boptsCli n False False
in PSUpstream (mpiVersion mpi) Snap (mpiFlags mpi) (mpiGhcOptions mpi ++ configOpts) (mpiGitSHA1 mpi)
] `Map.difference` Map.fromList (map (, ()) (HashSet.toList wiredInPackages))

return (targets, mbp, locals, nonLocalTargets, sourceMap)
Expand Down

0 comments on commit 675f834

Please sign in to comment.