haskell / haskell/cabal

`build-tool-depends` executables don't have a `.conf` file

Open
#8,434 30 comments 1 reaction 0 assignees View on GitHub
cabal-install: nix integration re: build-tool
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

This is a problem that manifests when trying to use `haskell.nix`. If it sees the `build-tool-depends` entries, it *does* try to build them, but then `cabal build` is unable to see or execute them.

Cf https://github.com/input-output-hk/haskell.nix/issues/839#issuecomment-883849093

> Note that this really isn't specific shellFor, but specific to v2 cabal. You can always use `v1-*` cabal commands to get the old behavior (see `SolveExecutables` in cabal code). I think a reason this is coming up recently is that cabal 3.4.0.0 made v2 the default.
>
> The reason this is really difficult is that both Nixpkgs & haskell.nix use the Setup.hs method of configure / install, which doesn't install a .conf file for executable components. I'm not sure if it makes more sense to
>
> See Cabal comment for reference:
>
> > build-tools dependencies
> > NB: Only include these dependencies if SolveExecutables
> > is True. It might be false in the legacy solver
> > codepath, in which case there won't be any record of
> > an executable we need.

I'm unclear whether or not this is a feasible or acceptable approach, and would appreciate guidance on this. @matthewbauer says that we can either

1. "Patch Cabal so Setup.hs method installs executables correctly,"
2. "or try to switch to the new install method." (what is the new install method to use?)

Contributor guide

Open the contributing guide

Research direction

Start by reading the issue's references to haskell.nix issue 839 and the Cabal comment about SolveExecutables, then compare the Setup.hs and new install-method behavior mentioned here. Determine whether either approach makes build-tool-depends executables visible to cabal build under the v2 solver; done requires an agreed implementation direction and a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.