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

The "benchmark" target dependencies conflict with "executable" targets #1768

Closed
nikita-volkov opened this issue Apr 11, 2014 · 7 comments
Closed
Milestone

Comments

@nikita-volkov
Copy link

I have a package with the following structure:

library
  ...
executable measure-memory
  ...
  build-depends:
    ghc-datasize,
    ...
benchmark benchmarks
  ...
  build-depends:
    criterion == 0.8.*,
    ...

The criterion == 0.8.* dependency conflicts with ghc-datasize and its impossible to compile having those two together. The issue with Cabal however is that neither the benchmark or library target has ghc-datasize in dependencies, yet Cabal still considers it and does not allow me to compile the benchmark target. When I remove the executable target, the compilation goes fine.

I'm on

$ cabal --version
cabal-install version 1.19.2
using version 1.19.2 of the Cabal library 
@tibbe
Copy link
Member

tibbe commented Apr 11, 2014

/cc @kosmikus

This is a limitation of the dependency solver and it bites us in a bunch of different situations. :(

Another example of when it bites us is when a cycle is created because a dependency of a test suite in turn depends on the main library. This happens in all core packages that are used by e.g. test-framework or criterion.

@nikita-volkov
Copy link
Author

BTW, I've just checked and the problem remains even when I change the target from benchmark benchmarks to executable benchmarks. So it looks like the issue is that it shares dependencies across all executables and benchmarks.

@tibbe
Copy link
Member

tibbe commented Apr 11, 2014

Yes, the issue is that the whole package is considered as a unit for dependency resolution.

@kosmikus
Copy link
Contributor

@tibbe You've said repeatedly that this is a solver shortcoming, but I don't see the solver as the main culprit. Can we build individual components of packages out of order? If yes, I'm happy to try to make the necessary solver changes.

@tibbe
Copy link
Member

tibbe commented Apr 17, 2014

@kosmikus Yes, I think we can and should consider each section (i.e. the lib, exes, test suites, and benchmarks) as separate units, with their own constraints, to build.

@23Skidoo
Copy link
Member

Cabal has an internal component dependency graph. This information needs to be communicated to the solver.

@ttuegel ttuegel added this to the _|_ milestone Apr 24, 2015
@23Skidoo
Copy link
Member

Closing as a duplicate of #1575.

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

5 participants