Closed TerrorJack closed 4 years ago
Just figured out the problem goes away if the with-hpack
option is commented out in ~/.stack/config.yaml
. It may still be a bug, but of course, feel free to close this one.
Thanks for reporting this @TerrorJack.
Tracing through the code quickly, it looks to me like your fix is the only safe solution since the with-hpack
configuration knob you mention ultimately toggles what happens here in the Pantry codebase:
case he of
HpackBundled -> do
r <- liftIO $ Hpack.hpackResult $ Hpack.setProgramName "stack" $ Hpack.setTarget (toFilePath hpackFile) Hpack.defaultOptions
forM_ (Hpack.resultWarnings r) (logWarn . fromString)
let cabalFile = fromString . Hpack.resultCabalFile $ r
case Hpack.resultStatus r of
Hpack.Generated -> logDebug $ "hpack generated a modified version of " <> cabalFile
Hpack.OutputUnchanged -> logDebug $ "hpack output unchanged in " <> cabalFile
Hpack.AlreadyGeneratedByNewerHpack -> logWarn $
cabalFile <>
" was generated with a newer version of hpack,\n" <>
"please upgrade and try again."
Hpack.ExistingCabalFileWasModifiedManually -> logWarn $
cabalFile <>
" was modified manually. Ignoring " <>
fromString (toFilePath hpackFile) <>
" in favor of the cabal file.\nIf you want to use the " <>
fromString (toFilePath (filename hpackFile)) <>
" file instead of the cabal file,\n" <>
"then please delete the cabal file."
HpackCommand command ->
withWorkingDir (toFilePath pkgDir) $
proc command [] runProcess_
Spawning an external hpack
in the HpackCommand
stanza rather than using an integrated library means we can't know exactly how to intercept its output (because it may differ by version), so I'd say this is working as expected.
General summary/comments (optional)
stack path --local-doc-root
produces redundant output forhpack
projects.Steps to reproduce
stack build --haddock
in anhpack
project's root directorystack path --local-doc-root
Expected
A one-line output which is the documentation root path.
Actual
The output looks something like:
The verbose log is available at https://gist.github.com/TerrorJack/604f516e90ce9cc379e0b5174da9a60b
Stack version
Method of installation
Built using a
lts-16
stackage snapshot andstack