haskell / haskell/cabal

`build-type: Hooks`: Lift restriction regarding per-component builds

Open
#10,983 4 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I'd like to use `build-type: Hooks` in a package that has internal sublibraries.
Since packages containing internal sublibraries force a per-component build thaty is currently not possible:
```
Error:
Internal libraries only supported with per-component builds.
Per-component builds were disabled because build-type is Hooks
In the inplace package 'thrift-lib-0.1.0.1'
```
More specifically, building `thrift-lib` requires the compilation of some Thrift interface files to Haskell modules;
See https://github.com/facebookincubator/hsthrift/blob/e84c886276f39f6c55389c1f1bf96f90fe76f49e/Makefile#L29 for how it is currently done. As this compilation can be done per component, I wanted to add per-component hooks for the generation of the Haskell sources.
If a `SetupHook` files specifies only per-component hooks, then it should be safe to allow this in a per-component build, shouldn't it?

Related issue: ~https://github.com/haskell/cabal/issues/4548~ https://github.com/haskell/cabal/pull/10966

Contributor guide

Open the contributing guide

Research direction

Start with the reported error about internal libraries and per-component builds, then inspect the behavior discussed in related issue 4548 and pull request 10966. Compare the per-component hook requirements with the `SetupHook` behavior described here and verify the existing Cabal tests covering Hooks and internal libraries. Done means a package using only per-component hooks can build its internal components without this restriction.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.