input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
550 stars 237 forks source link

Executables are not used in `build-tool-depends` if the library is obtained via `haskell.nix` #1770

Open MangoIV opened 1 year ago

MangoIV commented 1 year ago

Describe the bug

When trying to use build-tool-depends: markdown-unlit:markdown-unlit

I get

plutarch-docs:markdown-unlit:exe.markdown-unlit-0.5.1/installed-4CgIbMeCiwSElzbwyyhikO
(does not contain executable 'markdown-unlit', which is required by my-library *test)

Which is wrong.

Steps To Reproduce

add the following to your cabal file:

  ghc-options: -pgmL markdown-unlit

  build-depends:
    , base
    , markdown-unlit

  build-tool-depends: markdown-unlit:markdown-unlit

Expected behavior

cabal manages to resolve the executable

Additional context

This is probably related to another issue I opened, #1662. Also related: https://github.com/haskell/cabal/issues/8481 https://github.com/input-output-hk/cardano-node/issues/4455

839

This doesn't happen in the testcases in haskell.nix (like test/shell-for) because the dependencies are not resolved via haskell.nix but locally via cabal.

This is a huge issue causing all sorts of ugly hacks in practice.

ParetoOptimalDev commented 1 year ago

Allso see https://github.com/input-output-hk/haskell.nix/issues/839

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ScottFreeCode commented 1 year ago

There are some other issues that might have the same underlying cause, here: https://gist.github.com/ScottFreeCode/ef9f254e2dd91544bba4a068852fc81f