Closed jtojnar closed 9 years ago
We should be able to make this change. I don't use this sort of hack anymore anywhere else in my packages.
I my experience problems with cabal versions changed can be resolved by cleaning out ~/.cabal/setup-exe-cache/
@glguy I tried nuking the ~/.cabal, .cabal-sandbox and ~/.ghc directories but no luck. According to someone on /r/haskell[1] it should be fixed in cabal 1.24 though.
@ekmett should I make a pull request then or are would you rather switch to Simple build-type completely?
Using the following stack.yaml I was able to successfully execute stack test
. This was after updating the doctest dependency bound. I don't know if that was related.
resolver: ghc-7.10
flags:
text:
integer-simple: false
extra-deps:
- HUnit-1.3.0.0
- StateVar-1.1.0.1
- adjunctions-4.2.2
- ansi-terminal-0.6.2.3
- ansi-wl-pprint-0.6.7.3
- base-orphans-0.4.4
- bifunctors-5
- bytes-0.15.0.1
- cereal-0.4.1.1
- comonad-4.2.7.2
- contravariant-1.3.3
- distributive-0.4.4
- doctest-0.10.1
- exceptions-0.8.0.2
- extensible-exceptions-0.1.1.4
- free-4.12.1
- ghc-paths-0.1.0.9
- hashable-1.2.3.3
- hostname-1.0
- kan-extensions-4.2.3
- lens-4.13
- mtl-2.2.1
- nats-1
- old-locale-1.0.0.7
- parallel-3.2.0.6
- prelude-extras-0.4.0.2
- primitive-0.6
- profunctors-5.1.1
- random-1.1
- reflection-2.1
- regex-base-0.93.2
- regex-posix-0.95.2
- semigroupoids-5.0.0.4
- semigroups-0.17.0.1
- simple-reflect-0.3.2
- stm-2.4.4
- syb-0.5.1
- tagged-0.8.1
- test-framework-0.8.1.1
- test-framework-hunit-0.3.0.2
- text-1.2.1.3
- transformers-compat-0.4.0.4
- unordered-containers-0.2.5.1
- vector-0.11.0.0
- void-0.7.1
- xml-1.3.14
@glguy you can also use to make things simpler
flags:
linear:
template-haskell: true
packages:
- '.'
extra-deps: []
resolver: lts-3.5
I'm not so much worried about the stack.yaml as figuring out what the issue is that needs to be resolved.
Maybe it is related to this issue? https://github.com/haskell/cabal/issues/1434
I tried rebuilding with your stack.yaml and got the same problem until I removed the optP arguments.
This reminds me of an issue we had on lens. Perhaps your version of cpphs is out of date?
Ah, I see. It stopped working for me once I removed the /dist directory that cabal left behind
We can't switch to a Simple
build plan. Otherwise when multiple versions of a package are installed in the users package database then the doctests don't work for them. Not everyone uses stack
.
We can remove the
: "-optP-include"
: "-optPdist/build/autogen/cabal_macros.h"
lines however.
Actually I don't think that we can remove them. We may need to modify the Build_doctests
thing to contain the actual build dir, rather than assume dist
, then use that in tests/doctests.hsc
Leaving this open until I can confirm that that fix works.
@ekmett tests now work but you still can’t run stack ghci
.
What goes wrong with stack ghci
?
I dropped the .ghci
file in HEAD. Setting up stack
locally for a test, but you can give it a shot off HEAD directly if you like.
It seems to work now. Previously the same error could be seen.
Configuring GHCi with the following packages: linear
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
<command-line>:10:0:
fatal error: dist/build/autogen/cabal_macros.h: No such file or directory
compilation terminated.
phase `C pre-processor' failed (exitcode = 1)
It seems to start working when I remove the optP arguments but I am not sure if this is a correct way to fix this.I can’t test it with cabal sandbox due to "version of Cabal has changed" bug.