问题描述
我非常喜欢堆栈,我已经从我的机器上完全删除了任何独立的cabal和ghc可执行文件(允许堆栈在它自己的神秘〜/ .stack /目录中安装任何需要的文件)....
但是,它看起来像一些标志在堆栈下不能正常工作。例如,我想使用 -ddump-minimal-imports
。在cabal中,这将是
cabal build --ghc-option = -ddump-minimal-imports
显而易见的翻译是
stack build --ghc-options -ddump-minimal-imports
这会运行,但不会产生任何结果可执行文件(据我所知,至少....也许输出是在神秘的〜/ .stack目录中的某处)。
有没有办法要做到这一点?
我刚试过,使用 stack build --ghc-options = - ddump-minimal-imports
,并在 ./。中生成输出文件。stack-work / dist / x86_64-osx / Cabal-1.22.4.0 / build /
$ $ p $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ - -ddump-minimal-imports
stack-0.1.5.0:configure
配置堆栈-0.1.5.0 ...
stack-0.1.5.0:build
预处理库堆栈-0.1 .5.0 ...
[1 of 69]编译Data.Set.Monad(s rc / Data / Set / Monad.hs,.stack-work / dist / x86_64-osx / Cabal-1.22.4.0 / build / Data / Set / Monad.o)
编译Data.Attoparsec .Combinators(src / Data / Attoparsec / Combinators.hs,.stack-work / dist / x86_64-osx / Cabal-1.22.4.0 / build / Data / Attoparsec / Combinators.o)
[编译] Network.HTTP.Download.Verified(src / Network / HTTP / Download / Verified.hs,.stack-work / dist / x86_64-osx / Cabal-1.22.4.0 / build / Network / HTTP / Download / Verified.o)
^ Cuser中断
$查找。 -name'* imports *'
./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Data.Attoparsec.Combinators.imports
./.stack-work/ dist / x86_64-osx / Cabal-1.22.4.0 / build / Data.Set.Monad.imports
./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Network.HTTP。 Download.Verified.imports
I am such a big fan of stack, that I've removed any independent cabal and ghc executables completely from my machine (letting stack install whatever it needs in its own mysterious ~/.stack/ directory)....
However, it looks like some flags aren't working properly under stack. For instance, I want to use -ddump-minimal-imports
. In cabal this would be
cabal build --ghc-option=-ddump-minimal-imports
The obvious translation would be
stack build --ghc-options -ddump-minimal-imports
This runs, but produces nothing but the executable (as far as I can tell, at least.... Perhaps the output is somewhere in the mysterious ~/.stack dir).
Is there a way to do this?
I just tried this, using stack build --ghc-options=-ddump-minimal-imports
, and it produced output files in ./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/
, e.g.:
$ stack clean
$ stack build --ghc-options=-ddump-minimal-imports
stack-0.1.5.0: configure
Configuring stack-0.1.5.0...
stack-0.1.5.0: build
Preprocessing library stack-0.1.5.0...
[ 1 of 69] Compiling Data.Set.Monad ( src/Data/Set/Monad.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Data/Set/Monad.o )
[ 2 of 69] Compiling Data.Attoparsec.Combinators ( src/Data/Attoparsec/Combinators.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Data/Attoparsec/Combinators.o )
[ 3 of 69] Compiling Network.HTTP.Download.Verified ( src/Network/HTTP/Download/Verified.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Network/HTTP/Download/Verified.o )
^Cuser interrupt
$ find . -name '*imports*'
./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Data.Attoparsec.Combinators.imports
./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Data.Set.Monad.imports
./.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Network.HTTP.Download.Verified.imports
这篇关于如何使用“-ddump-minimal-imports”与堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!