Skip to content

Commit

Permalink
Upgrade to hpack 0.20.0 (fixes #3383)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Nov 19, 2017
1 parent 6679ad4 commit 57af148
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Expand Up @@ -118,6 +118,9 @@ Other enhancements:
* Passing non local packages as targets to `stack ghci` will now
cause them to be used as `-package` args along with package
hiding.
* Detect when user changed .cabal file instead of package.yaml. This
was implemented upstream in hpack. See
[#3383](https://github.com/commercialhaskell/stack/issues/3383).

Bug fixes:

Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Expand Up @@ -63,7 +63,7 @@ dependencies:
- hackage-security
- hashable
- hastache
- hpack
- hpack >= 0.20
- hpc
- http-client
- http-client-tls
Expand Down
13 changes: 8 additions & 5 deletions src/Stack/Package.hs
Expand Up @@ -1321,11 +1321,7 @@ hpack pkgDir = do
config <- view configL
case configOverrideHpack config of
HpackBundled -> do
#if MIN_VERSION_hpack(0,18,0)
r <- liftIO $ Hpack.hpackResult (Just $ toFilePath pkgDir)
#else
r <- liftIO $ Hpack.hpackResult (toFilePath pkgDir)
#endif
r <- liftIO $ Hpack.hpackResult (Just $ toFilePath pkgDir) Hpack.NoForce
forM_ (Hpack.resultWarnings r) prettyWarnS
let cabalFile = styleFile . fromString . Hpack.resultCabalFile $ r
case Hpack.resultStatus r of
Expand All @@ -1338,6 +1334,13 @@ hpack pkgDir = do
, flow "was generated with a newer version of hpack,"
, flow "please upgrade and try again."
]
Hpack.ExistingCabalFileWasModifiedManually -> prettyWarnL
[ flow "WARNING: "
, cabalFile
, flow " was modified manually. Ignoring package.yaml in favor of cabal file."
, flow "If you want to use package.yaml instead of the cabal file, "
, flow "then please delete the cabal file."
]
HpackCommand command -> do
envOverride <- getMinimalEnvOverride
let cmd = Cmd (Just pkgDir) command envOverride []
Expand Down
1 change: 1 addition & 0 deletions stack-nightly.yaml
Expand Up @@ -8,3 +8,4 @@ nix:
extra-deps:
- bindings-uname-0.1
- conduit-extra-1.2.0
- hpack-0.20.0
1 change: 1 addition & 0 deletions stack.yaml
Expand Up @@ -25,3 +25,4 @@ extra-deps:
- path-io-1.3.3
- extra-1.6
- hsc2hs-0.68.2
- hpack-0.20.0

0 comments on commit 57af148

Please sign in to comment.