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

Cannot configure containers with tests and benchmarks enabled #462

Closed
m-renaud opened this issue Dec 26, 2017 · 8 comments
Closed

Cannot configure containers with tests and benchmarks enabled #462

m-renaud opened this issue Dec 26, 2017 · 8 comments
Assignees

Comments

@m-renaud
Copy link
Contributor

I'm not sure if this is a containers problem or cabal problem, but cabal configure --enable-tests --enable-benchmarks is unable to solve the constraints:

$ cabal configure --enable-tests --enable-benchmarks

Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
rejecting: containers-0.5.10.2:!bench (constraint from config file, command
line flag, or user target requires opposite flag selection)
trying: containers-0.5.10.2:*bench
unknown package: random (dependency of containers-0.5.10.2:*bench)
Dependency tree exhaustively searched.
Trying configure anyway.
Configuring containers-0.5.10.2...
cabal: Encountered missing dependencies:
ChasingBottoms -any,
HUnit -any,
QuickCheck >=2.7.1,
criterion >=0.4.0 && <1.3,
random <1.2,
test-framework >=0.3.3,
test-framework-hunit -any,
test-framework-quickcheck2 >=0.2.9

This causes our instructions in CONTRIBUTING.md to be more complex than they should be.

@hvr
Copy link
Member

hvr commented Dec 28, 2017

kinda related discussion at haskell/cabal#4981 (comment)

@sjakobi
Copy link
Member

sjakobi commented Dec 29, 2017

With regards to benchmarks I think we should switch from criterion to gauge once a new release of gauge has been made. The upstream version of gauge has neither direct nor transitive dependencies on containers.

@treeowl
Copy link
Contributor

treeowl commented Dec 29, 2017

@sjakobi, how does gauge compare to criterion? What else do we gain/lose? How hard would it be to port the existing benchmark suite?

@treeowl
Copy link
Contributor

treeowl commented Dec 29, 2017

@sjakobi, I took a glance at gauge. I think it would be good to add support for it, but it's clearly less capable than criterion, so I'm reluctant to make a hard switch. I also must say I'm not entirely sold on the way it cuts down dependencies, seeming to focus for now on human-readable output. But I can probably be convinced.

@sjakobi
Copy link
Member

sjakobi commented Dec 29, 2017

gauge is just fork of criterion with much fewer dependencies and a few additional features.

how does gauge compare to criterion?

See https://github.com/vincenthz/hs-gauge#features-compared-to-criterion.

What else do we gain/lose?

gauge only supports GHC versions >= 7.8.

How hard would it be to port the existing benchmark suite?

So far it's been as simple as replacing the imports of Criterion and Criterion.Main with import Gauge.

it's clearly less capable than criterion

What features do you miss the most?

@sjakobi
Copy link
Member

sjakobi commented Mar 17, 2019

Here's a trick for building tests and benchmarks with cabal:

mv containers.cabal kontainers.cabal
sed -i 's/name: containers/name: kontainers/1' kontainers.cabal 
sed -i 's/containers,/kontainers,/g' kontainers.cabal

This renames the package to kontainers, removing the circular dependency.

@sjakobi
Copy link
Member

sjakobi commented May 30, 2019

This has been fixed in #626.

To avoid the test dependencies getting rebuilt with every library change, it's enough to remove containers from the packages stanza in the cabal.project. It would be good to document this properly though…

@sjakobi
Copy link
Member

sjakobi commented Dec 12, 2019

@m-renaud Can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants