haskell / haskell/cabal

Add support for "setup" components to target selector & new-build

Open
#4,675 2 comments 1 reaction 0 assignees View on GitHub
cabal-install: v2-build system type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Currently, we cannot refer to `custom-setup` components

See [`Distribution.Client.TargetSelector`](https://github.com/haskell/cabal/blob/master/cabal-install/Distribution/Client/TargetSelector.hs) for currently supported syntax.

In order to reify custom-setup components in the target selector syntax, we'd have to introduce a new (singleton) namespace "`setup`", which has ~~only~~at most a single inhabitant (hence a singleton -- however, this inhabitant only exists for `build-type:custom` packages), also named "`setup`". Consequently, this gives us the following ways to refer to the custom setup script for a package foo

- `foo:setup` (package-name : component-name)
- `setup` (component-name)
- `setup:setup` (namespace-name : component-name)
- `foo:setup:setup` (package-name : namespace-name : component-name )
- `:pkg:foo:setup:setup` (explicitly qualified package-name : namespace-name : component-name )

(Optional) Moreover, we could add the "filter" `setups`, which then gives us the ability to refer to custom-setups components of multiple packages via

- `setups`
- `all:setups`
- `:all:setups`
- `foo:setups` (trivial: all `setup` components in the package `foo`; IOW, same as `foo:setup:setup`)

This may be a pre-requisite for #4293 which needs the ability to `cabal new-build setup(s)` w/o building all remaining targets.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.