Comments (15)
@RyanGlScott can you paste the output of cabal test doctest
(the test.log) in successful case?
And also find dist
?
from cabal-doctest.
Note: there is no need to depend on the library, as we should pass everything to doctests
to load the package in GHCi. In that scenari we seem to forget something...
(cbits
is different...)
from cabal-doctest.
@RyanGlScott can you paste the output of
cabal test doctest
(the test.log) in successful case?
Here's the full output of cabal test doctests
:
$ cabal test doctests
[1 of 1] Compiling Main ( dist/setup/setup.hs, dist/setup/Main.o ) [flags changed]
Linking ./dist/setup/setup ...
Preprocessing library for parsers-0.12.5..
Building library for parsers-0.12.5..
[1 of 8] Compiling Text.Parser.Combinators ( src/Text/Parser/Combinators.hs, dist/build/Text/Parser/Combinators.o )
[2 of 8] Compiling Text.Parser.Char ( src/Text/Parser/Char.hs, dist/build/Text/Parser/Char.o )
[3 of 8] Compiling Text.Parser.Expression ( src/Text/Parser/Expression.hs, dist/build/Text/Parser/Expression.o )
src/Text/Parser/Expression.hs:115:15: warning: [-Wmonomorphism-restriction]
• The Monomorphism Restriction applies to the bindings for ‘rassoc’,
‘lassoc’, ‘nassoc’, ‘prefix’,
‘postfix’
Consider giving a type signature for these binders
• In the expression:
let
rassoc, lassoc, nassoc :: [m (a -> a -> a)]
prefix, postfix :: [m (a -> a)]
(rassoc, lassoc, nassoc, prefix, postfix)
= foldr splitOp ([], [], [], [], []) ops
....
in
termP <**> (rassocP <|> lassocP <|> nassocP <|> pure id)
<?> "operator"
In an equation for ‘makeParser’:
makeParser term ops
= let
rassoc, lassoc, nassoc :: [m (a -> a -> a)]
prefix, postfix :: [m (a -> a)]
....
in
termP <**> (rassocP <|> lassocP <|> nassocP <|> pure id)
<?> "operator"
In an equation for ‘buildExpressionParser’:
buildExpressionParser operators simpleExpr
= foldl makeParser simpleExpr operators
where
makeParser term ops
= let ...
in
termP <**> (rassocP <|> lassocP <|> nassocP <|> pure id)
<?> "operator"
splitOp (Infix op assoc) (rassoc, lassoc, nassoc, prefix, postfix)
= case assoc of
AssocNone -> ...
AssocLeft -> ...
AssocRight -> ...
splitOp (Prefix op) (rassoc, lassoc, nassoc, prefix, postfix)
= (rassoc, lassoc, nassoc, op : prefix, postfix)
splitOp (Postfix op) (rassoc, lassoc, nassoc, prefix, postfix)
= (rassoc, lassoc, nassoc, prefix, op : postfix)
|
115 | (rassoc,lassoc,nassoc,prefix,postfix) = foldr splitOp ([],[],[],[],[]) ops
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[4 of 8] Compiling Text.Parser.LookAhead ( src/Text/Parser/LookAhead.hs, dist/build/Text/Parser/LookAhead.o )
[5 of 8] Compiling Text.Parser.Permutation ( src/Text/Parser/Permutation.hs, dist/build/Text/Parser/Permutation.o )
[6 of 8] Compiling Text.Parser.Token.Highlight ( src/Text/Parser/Token/Highlight.hs, dist/build/Text/Parser/Token/Highlight.o )
[7 of 8] Compiling Text.Parser.Token ( src/Text/Parser/Token.hs, dist/build/Text/Parser/Token.o )
src/Text/Parser/Token.hs:642:38: warning: [-Wincomplete-uni-patterns]
Pattern match(es) are non-exhaustive
In a pattern binding: Patterns not matched: (_, [])
|
642 | (low, ex : high) = splitAt bd dps
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[8 of 8] Compiling Text.Parser.Token.Style ( src/Text/Parser/Token/Style.hs, dist/build/Text/Parser/Token/Style.o )
Preprocessing test suite 'doctests' for parsers-0.12.5..
Building test suite 'doctests' for parsers-0.12.5..
<no location info>: warning: [-Wmissing-home-modules]
These modules are needed for compilation but not listed in your .cabal file's other-modules: Build_doctests
[1 of 2] Compiling Build_doctests ( dist/build/doctests/autogen/Build_doctests.hs, dist/build/doctests/doctests-tmp/Build_doctests.o )
[2 of 2] Compiling Main ( tests/doctests.hs, dist/build/doctests/doctests-tmp/Main.o )
<no location info>: warning: [-Wmissing-home-modules]
These modules are needed for compilation but not listed in your .cabal file's other-modules: Build_doctests
Linking dist/build/doctests/doctests ...
Running 1 test suites...
Test suite doctests: RUNNING...
Test suite doctests: PASS
Test suite logged to: dist/test/parsers-0.12.5-doctests.log
1 of 1 test suites (1 of 1 test cases) passed.
And here's the contents of dist/test/parsers-0.12.5-doctests.log
:
$ more dist/test/parsers-0.12.5-doctests.log
Test suite doctests: RUNNING...
Examples: 0 Tried: 0 Errors: 0 Failures: 0
-i
-i/home/rgscott/Documents/Hacking/Haskell/parsers-0.12.5/dist/build/autogen
-i/home/rgscott/Documents/Hacking/Haskell/parsers-0.12.5/dist/build
-i/home/rgscott/Documents/Hacking/Haskell/parsers-0.12.5/src
-hide-all-packages
-package-db=dist/package.conf.inplace
-optP-include
-optPdist/build/autogen/cabal_macros.h
-package-id=base-4.10.0.0
-package-id=base-orphans-0.6-9iPDLrUqQ5yHb9fb9OUZ9L
-package-id=charset-0.3.7.1-GkbAILH2Vj9HXMMGXPSeNg
-package-id=containers-0.5.10.2
-package-id=parsec-3.1.11-DPgnR92AWEaFOaixmwipet
-package-id=attoparsec-0.13.1.0-2xtipSJ3oFDBfLwedqccX
-package-id=text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
-package-id=transformers-0.5.2.0
-package-id=mtl-2.2.1-19EL8AGBsN3DnnOhrC9xY3
-package-id=scientific-0.3.5.1-L0qYzdp0wpz8rO8gircNSR
-package-id=unordered-containers-0.2.8.0-HVcKYx0GQoVIIbKuoCcJbx
-package-id=bytestring-0.10.8.2
-package-id=directory-1.3.0.2
-package-id=doctest-0.12.0-JcuLvnckae744xvqjXdMWF
-package-id=filepath-1.4.1.2
-package=parsers-0.12.5
-package-id=QuickCheck-2.10.0.1-DTIBC3CyU6p3h4xSnOjkg1
-package-id=quickcheck-instances-0.3.16-A15GUudjPiB6fV2AyfxwM5
Text.Parser.Char
Text.Parser.Combinators
Text.Parser.LookAhead
Text.Parser.Permutation
Text.Parser.Expression
Text.Parser.Token
Text.Parser.Token.Style
Text.Parser.Token.Highlight
Test suite doctests: PASS
Test suite logged to: dist/test/parsers-0.12.5-doctests.log
And also
find dist
?
$ find dist
dist
dist/package.conf.inplace
dist/package.conf.inplace/parsers-0.12.5-BbWYl7dZaXs10a39DfSMvp.conf
dist/package.conf.inplace/package.cache.lock
dist/package.conf.inplace/package.cache
dist/build
dist/build/libHSparsers-0.12.5-BbWYl7dZaXs10a39DfSMvp-ghc8.2.1.so
dist/build/Text
dist/build/Text/Parser
dist/build/Text/Parser/Token.dyn_hi
dist/build/Text/Parser/Combinators.o
dist/build/Text/Parser/LookAhead.o
dist/build/Text/Parser/Char.dyn_o
dist/build/Text/Parser/Permutation.dyn_o
dist/build/Text/Parser/Expression.dyn_o
dist/build/Text/Parser/Expression.dyn_hi
dist/build/Text/Parser/Permutation.o
dist/build/Text/Parser/Char.dyn_hi
dist/build/Text/Parser/Char.hi
dist/build/Text/Parser/LookAhead.dyn_o
dist/build/Text/Parser/Expression.o
dist/build/Text/Parser/Combinators.dyn_o
dist/build/Text/Parser/Token.hi
dist/build/Text/Parser/Char.o
dist/build/Text/Parser/Expression.hi
dist/build/Text/Parser/Permutation.hi
dist/build/Text/Parser/Token.o
dist/build/Text/Parser/Token
dist/build/Text/Parser/Token/Highlight.dyn_o
dist/build/Text/Parser/Token/Highlight.o
dist/build/Text/Parser/Token/Highlight.hi
dist/build/Text/Parser/Token/Style.dyn_hi
dist/build/Text/Parser/Token/Style.dyn_o
dist/build/Text/Parser/Token/Highlight.dyn_hi
dist/build/Text/Parser/Token/Style.hi
dist/build/Text/Parser/Token/Style.o
dist/build/Text/Parser/LookAhead.hi
dist/build/Text/Parser/Combinators.dyn_hi
dist/build/Text/Parser/Combinators.hi
dist/build/Text/Parser/LookAhead.dyn_hi
dist/build/Text/Parser/Permutation.dyn_hi
dist/build/Text/Parser/Token.dyn_o
dist/build/libHSparsers-0.12.5-BbWYl7dZaXs10a39DfSMvp.a
dist/build/autogen
dist/build/autogen/cabal_macros.h
dist/build/autogen/Paths_parsers.hs
dist/build/doctests
dist/build/doctests/autogen
dist/build/doctests/autogen/cabal_macros.h
dist/build/doctests/autogen/Build_doctests.hs
dist/build/doctests/autogen/Paths_parsers.hs
dist/build/doctests/doctests-tmp
dist/build/doctests/doctests-tmp/Main.o
dist/build/doctests/doctests-tmp/Build_doctests.hi
dist/build/doctests/doctests-tmp/Main.hi
dist/build/doctests/doctests-tmp/Build_doctests.o
dist/build/doctests/doctests
dist/setup-config
dist/cabal-config-flags
dist/test
dist/test/parsers-0.12.5.log
dist/test/parsers-0.12.5-doctests.log
dist/setup
dist/setup/Main.o
dist/setup/setup.version
dist/setup/Main.hi
dist/setup/setup
dist/setup/setup.hs
dist/setup/setup_macros.h
dist/hpc
dist/hpc/vanilla
dist/hpc/vanilla/tix
dist/hpc/vanilla/tix/doctests
rgscott@gearloose:~/.../Hacking/Haskell/parsers-0.12.5$ find dist
dist
dist/package.conf.inplace
dist/package.conf.inplace/parsers-0.12.5-BbWYl7dZaXs10a39DfSMvp.conf
dist/package.conf.inplace/package.cache.lock
dist/package.conf.inplace/package.cache
dist/build
dist/build/libHSparsers-0.12.5-BbWYl7dZaXs10a39DfSMvp-ghc8.2.1.so
dist/build/Text
dist/build/Text/Parser
dist/build/Text/Parser/Token.dyn_hi
dist/build/Text/Parser/Combinators.o
dist/build/Text/Parser/LookAhead.o
dist/build/Text/Parser/Char.dyn_o
dist/build/Text/Parser/Permutation.dyn_o
dist/build/Text/Parser/Expression.dyn_o
dist/build/Text/Parser/Expression.dyn_hi
dist/build/Text/Parser/Permutation.o
dist/build/Text/Parser/Char.dyn_hi
dist/build/Text/Parser/Char.hi
dist/build/Text/Parser/LookAhead.dyn_o
dist/build/Text/Parser/Expression.o
dist/build/Text/Parser/Combinators.dyn_o
dist/build/Text/Parser/Token.hi
dist/build/Text/Parser/Char.o
dist/build/Text/Parser/Expression.hi
dist/build/Text/Parser/Permutation.hi
dist/build/Text/Parser/Token.o
dist/build/Text/Parser/Token
dist/build/Text/Parser/Token/Highlight.dyn_o
dist/build/Text/Parser/Token/Highlight.o
dist/build/Text/Parser/Token/Highlight.hi
dist/build/Text/Parser/Token/Style.dyn_hi
dist/build/Text/Parser/Token/Style.dyn_o
dist/build/Text/Parser/Token/Highlight.dyn_hi
dist/build/Text/Parser/Token/Style.hi
dist/build/Text/Parser/Token/Style.o
dist/build/Text/Parser/LookAhead.hi
dist/build/Text/Parser/Combinators.dyn_hi
dist/build/Text/Parser/Combinators.hi
dist/build/Text/Parser/LookAhead.dyn_hi
dist/build/Text/Parser/Permutation.dyn_hi
dist/build/Text/Parser/Token.dyn_o
dist/build/libHSparsers-0.12.5-BbWYl7dZaXs10a39DfSMvp.a
dist/build/autogen
dist/build/autogen/cabal_macros.h
dist/build/autogen/Paths_parsers.hs
dist/build/doctests
dist/build/doctests/autogen
dist/build/doctests/autogen/cabal_macros.h
dist/build/doctests/autogen/Build_doctests.hs
dist/build/doctests/autogen/Paths_parsers.hs
dist/build/doctests/doctests-tmp
dist/build/doctests/doctests-tmp/Main.o
dist/build/doctests/doctests-tmp/Build_doctests.hi
dist/build/doctests/doctests-tmp/Main.hi
dist/build/doctests/doctests-tmp/Build_doctests.o
dist/build/doctests/doctests
dist/setup-config
dist/cabal-config-flags
dist/test
dist/test/parsers-0.12.5.log
dist/test/parsers-0.12.5-doctests.log
dist/setup
dist/setup/Main.o
dist/setup/setup.version
dist/setup/Main.hi
dist/setup/setup
dist/setup/setup.hs
dist/setup/setup_macros.h
dist/hpc
dist/hpc/vanilla
dist/hpc/vanilla/tix
dist/hpc/vanilla/tix/doctests
from cabal-doctest.
Note: there is no need to depend on the library, as we should pass everything to
doctests
to load the package in GHCi. In that scenari we seem to forget something...
My hunch is that dist/build/autogen/cabal_macros.h
only gets built when the library is built. If you only build the doctests
test suite, then the only thing that gets built is dist/build/doctests/autogen/cabal_macros.h
.
from cabal-doctest.
@RyanGlScott is it so, when there isn't dependency on parsers
in test-suite, and you say cabal test doctest
then the library isn't build?
from cabal-doctest.
@RyanGlScott exactly. So we don't really depend on the library, but we depend on the fact it should be configured (not built!)
I have to think about this.
from cabal-doctest.
I cannot reproduce this. Which cabal-install
do you use?
from cabal-doctest.
I've reproduced this with both 2.0 and 1.24.
from cabal-doctest.
Make sure you're doing this from a completely clean build, since the presence of dist/build/autogen/cabal_macros.h
will affect whether you can trigger the error or not.
from cabal-doctest.
I see. I cannot reproduce it with GHC-8.0.2, but I can with GHC-8.2.1
from cabal-doctest.
I asked @hvr and @ezyang if they know why cabal
works differently.
For the record, with cabal newbuild doctests
and running the binary manually you can reproduce that. Not via new-test
, it decides to build the library!
from cabal-doctest.
CC @angerman who contributed the doctest feature. It's probably just a simple bug. Oops, this is a bug on cabal-doctest, not the new native doctest support in Setup.
from cabal-doctest.
The most likely reason why this only repros on GHC 8.2 is because GHC 8.2 is bundled with Cabal 2.0, which correctly generates separate cabal_macros.h
for each component (and not just a single cabal_macros.h for the entire package.) So it is probably a bug in cabal-doctest where it is looking for the library macro, when it really should not: it should look at the component specific macro. See haskell/cabal#1893
from cabal-doctest.
FWIW, I also recall experiencing this issue (having the test suites build before the library after invoking cabal test
, where the test suites don't list the library as a dependency) when upgrading singletons
to use Cabal-2.0
, and singletons
doesn't use a custom setup script. (See goldfirere/singletons#182 (comment).) At the time, I gave up and just made the test suite list the singletons
library as an explicit dependency.
from cabal-doctest.
@ezyang it should look into library specific cabal_macros.h
, as doctest
is interpreting library files.
I guess there's no other way ATM than adding intra-dependency. It's semantically wrong, OTOH cabal-doctest
is a hack anyway.
from cabal-doctest.
Related Issues (20)
- Make a release HOT 3
- Build_doctests isn't generated unless Cabal file defines a library HOT 8
- Should use doctest's --no-magic to stop it from interfering HOT 3
- running cabal-doctest on code that does FFI HOT 7
- Failure with GHC 8.8 / Cabal 2.5 HOT 8
- Add a motivation for this library to readme.
- Getting can't find soure for Build_doctests error. HOT 12
- Build error with GHC-8.8.1 HOT 2
- Work better with Haskell.nix? HOT 2
- Deprecation plan HOT 1
- Consider generating `Build_*` modules for more than just test-suite targets HOT 3
- cabal install <packages> fails with "Could not find module ‘Distribution.Extra.Doctest’" HOT 2
- Readme and description mention closed issue HOT 1
- Dyplicate symbol definition failure HOT 3
- Add constraint `Cabal >=1.24` to example in README HOT 2
- Support for mixins HOT 6
- "Attempting to use module .. which is not loaded" error HOT 4
- Build failure with GHC 9.2 alpha-2 HOT 8
- Publish a version that accepts Cabal 3.6 HOT 3
- Dropping maintenance, takeovers welcome HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cabal-doctest.