diff --git a/ChangeLog.md b/ChangeLog.md index eb3d87d95c..5a3c2e4606 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -45,6 +45,9 @@ Behavior changes: * Stack will ask before saving hackage credentials to file. This new prompt can be avoided by using the `save-hackage-creds` setting. Please see [#2159](https://github.com/commercialhaskell/stack/issues/2159). +* `ghc-options:` for specific packages will now come after the options + specified for all packages / particular sets of packages. See + [#3573](https://github.com/commercialhaskell/stack/issues/3573). * The `pvp-bounds` feature is no longer fully functional, due to some issues with the Cabal library's printer. See [#3550](https://github.com/commercialhaskell/stack/issues/3550). diff --git a/src/Stack/Build/Source.hs b/src/Stack/Build/Source.hs index ff735dcbe4..6317e16546 100644 --- a/src/Stack/Build/Source.hs +++ b/src/Stack/Build/Source.hs @@ -148,14 +148,14 @@ getLocalFlags bconfig boptsCli name = Map.unions -- configuration and commandline. getGhcOptions :: BuildConfig -> BuildOptsCLI -> PackageName -> Bool -> Bool -> [Text] getGhcOptions bconfig boptsCli name isTarget isLocal = concat - [ Map.findWithDefault [] name (configGhcOptionsByName config) - , if isTarget - then Map.findWithDefault [] AGOTargets (configGhcOptionsByCat config) - else [] + [ Map.findWithDefault [] AGOEverything (configGhcOptionsByCat config) , if isLocal then Map.findWithDefault [] AGOLocals (configGhcOptionsByCat config) else [] - , Map.findWithDefault [] AGOEverything (configGhcOptionsByCat config) + , if isTarget + then Map.findWithDefault [] AGOTargets (configGhcOptionsByCat config) + else [] + , Map.findWithDefault [] name (configGhcOptionsByName config) , concat [["-fhpc"] | isLocal && toCoverage (boptsTestOpts bopts)] , if boptsLibProfile bopts || boptsExeProfile bopts then ["-fprof-auto","-fprof-cafs"]