Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to hpack 0.20.0 (fixes #3383) #3579

Merged
merged 1 commit into from Nov 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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